1#![doc = "MAVLink ualberta dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::{bitflags, Flags};
9use mavlink_core::{
10 bytes::Bytes, bytes_mut::BytesMut, types::CharArray, MavlinkVersion, Message, MessageData,
11};
12#[allow(unused_imports)]
13use num_derive::FromPrimitive;
14#[allow(unused_imports)]
15use num_derive::ToPrimitive;
16#[allow(unused_imports)]
17use num_traits::FromPrimitive;
18#[allow(unused_imports)]
19use num_traits::ToPrimitive;
20#[cfg(feature = "serde")]
21use serde::{Deserialize, Serialize};
22#[cfg(feature = "ts")]
23use ts_rs::TS;
24pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
25#[cfg_attr(feature = "ts", derive(TS))]
26#[cfg_attr(feature = "ts", ts(export))]
27#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
28#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29#[cfg_attr(feature = "serde", serde(tag = "type"))]
30#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31#[repr(u32)]
32#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
33pub enum ActuatorConfiguration {
34 #[doc = "Do nothing."]
35 ACTUATOR_CONFIGURATION_NONE = 0,
36 #[doc = "Command the actuator to beep now."]
37 ACTUATOR_CONFIGURATION_BEEP = 1,
38 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
39 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
40 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
41 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
42 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
43 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
44 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
45 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
46}
47impl ActuatorConfiguration {
48 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
49}
50impl Default for ActuatorConfiguration {
51 fn default() -> Self {
52 Self::DEFAULT
53 }
54}
55#[cfg_attr(feature = "ts", derive(TS))]
56#[cfg_attr(feature = "ts", ts(export))]
57#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
58#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
59#[cfg_attr(feature = "serde", serde(tag = "type"))]
60#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
61#[repr(u32)]
62#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
63pub enum ActuatorOutputFunction {
64 #[doc = "No function (disabled)."]
65 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
66 #[doc = "Motor 1"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
68 #[doc = "Motor 2"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
70 #[doc = "Motor 3"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
72 #[doc = "Motor 4"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
74 #[doc = "Motor 5"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
76 #[doc = "Motor 6"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
78 #[doc = "Motor 7"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
80 #[doc = "Motor 8"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
82 #[doc = "Motor 9"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
84 #[doc = "Motor 10"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
86 #[doc = "Motor 11"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
88 #[doc = "Motor 12"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
90 #[doc = "Motor 13"]
91 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
92 #[doc = "Motor 14"]
93 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
94 #[doc = "Motor 15"]
95 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
96 #[doc = "Motor 16"]
97 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
98 #[doc = "Servo 1"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
100 #[doc = "Servo 2"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
102 #[doc = "Servo 3"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
104 #[doc = "Servo 4"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
106 #[doc = "Servo 5"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
108 #[doc = "Servo 6"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
110 #[doc = "Servo 7"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
112 #[doc = "Servo 8"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
114 #[doc = "Servo 9"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
116 #[doc = "Servo 10"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
118 #[doc = "Servo 11"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
120 #[doc = "Servo 12"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
122 #[doc = "Servo 13"]
123 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
124 #[doc = "Servo 14"]
125 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
126 #[doc = "Servo 15"]
127 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
128 #[doc = "Servo 16"]
129 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
130}
131impl ActuatorOutputFunction {
132 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
133}
134impl Default for ActuatorOutputFunction {
135 fn default() -> Self {
136 Self::DEFAULT
137 }
138}
139#[cfg_attr(feature = "ts", derive(TS))]
140#[cfg_attr(feature = "ts", ts(export))]
141#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
143#[cfg_attr(feature = "serde", serde(tag = "type"))]
144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
145#[repr(u32)]
146#[doc = "Enumeration of the ADSB altimeter types"]
147pub enum AdsbAltitudeType {
148 #[doc = "Altitude reported from a Baro source using QNH reference"]
149 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
150 #[doc = "Altitude reported from a GNSS source"]
151 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
152}
153impl AdsbAltitudeType {
154 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
155}
156impl Default for AdsbAltitudeType {
157 fn default() -> Self {
158 Self::DEFAULT
159 }
160}
161#[cfg_attr(feature = "ts", derive(TS))]
162#[cfg_attr(feature = "ts", ts(export))]
163#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
165#[cfg_attr(feature = "serde", serde(tag = "type"))]
166#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
167#[repr(u32)]
168#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
169pub enum AdsbEmitterType {
170 ADSB_EMITTER_TYPE_NO_INFO = 0,
171 ADSB_EMITTER_TYPE_LIGHT = 1,
172 ADSB_EMITTER_TYPE_SMALL = 2,
173 ADSB_EMITTER_TYPE_LARGE = 3,
174 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
175 ADSB_EMITTER_TYPE_HEAVY = 5,
176 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
177 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
178 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
179 ADSB_EMITTER_TYPE_GLIDER = 9,
180 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
181 ADSB_EMITTER_TYPE_PARACHUTE = 11,
182 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
183 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
184 ADSB_EMITTER_TYPE_UAV = 14,
185 ADSB_EMITTER_TYPE_SPACE = 15,
186 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
187 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
188 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
189 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
190}
191impl AdsbEmitterType {
192 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
193}
194impl Default for AdsbEmitterType {
195 fn default() -> Self {
196 Self::DEFAULT
197 }
198}
199bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
200impl AdsbFlags {
201 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
202}
203impl Default for AdsbFlags {
204 fn default() -> Self {
205 Self::DEFAULT
206 }
207}
208bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
209impl AisFlags {
210 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
211}
212impl Default for AisFlags {
213 fn default() -> Self {
214 Self::DEFAULT
215 }
216}
217#[cfg_attr(feature = "ts", derive(TS))]
218#[cfg_attr(feature = "ts", ts(export))]
219#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
220#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
221#[cfg_attr(feature = "serde", serde(tag = "type"))]
222#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
223#[repr(u32)]
224#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
225pub enum AisNavStatus {
226 #[doc = "Under way using engine."]
227 UNDER_WAY = 0,
228 AIS_NAV_ANCHORED = 1,
229 AIS_NAV_UN_COMMANDED = 2,
230 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
231 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
232 AIS_NAV_MOORED = 5,
233 AIS_NAV_AGROUND = 6,
234 AIS_NAV_FISHING = 7,
235 AIS_NAV_SAILING = 8,
236 AIS_NAV_RESERVED_HSC = 9,
237 AIS_NAV_RESERVED_WIG = 10,
238 AIS_NAV_RESERVED_1 = 11,
239 AIS_NAV_RESERVED_2 = 12,
240 AIS_NAV_RESERVED_3 = 13,
241 #[doc = "Search And Rescue Transponder."]
242 AIS_NAV_AIS_SART = 14,
243 #[doc = "Not available (default)."]
244 AIS_NAV_UNKNOWN = 15,
245}
246impl AisNavStatus {
247 pub const DEFAULT: Self = Self::UNDER_WAY;
248}
249impl Default for AisNavStatus {
250 fn default() -> Self {
251 Self::DEFAULT
252 }
253}
254#[cfg_attr(feature = "ts", derive(TS))]
255#[cfg_attr(feature = "ts", ts(export))]
256#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
257#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
258#[cfg_attr(feature = "serde", serde(tag = "type"))]
259#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
260#[repr(u32)]
261#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
262pub enum AisType {
263 #[doc = "Not available (default)."]
264 AIS_TYPE_UNKNOWN = 0,
265 AIS_TYPE_RESERVED_1 = 1,
266 AIS_TYPE_RESERVED_2 = 2,
267 AIS_TYPE_RESERVED_3 = 3,
268 AIS_TYPE_RESERVED_4 = 4,
269 AIS_TYPE_RESERVED_5 = 5,
270 AIS_TYPE_RESERVED_6 = 6,
271 AIS_TYPE_RESERVED_7 = 7,
272 AIS_TYPE_RESERVED_8 = 8,
273 AIS_TYPE_RESERVED_9 = 9,
274 AIS_TYPE_RESERVED_10 = 10,
275 AIS_TYPE_RESERVED_11 = 11,
276 AIS_TYPE_RESERVED_12 = 12,
277 AIS_TYPE_RESERVED_13 = 13,
278 AIS_TYPE_RESERVED_14 = 14,
279 AIS_TYPE_RESERVED_15 = 15,
280 AIS_TYPE_RESERVED_16 = 16,
281 AIS_TYPE_RESERVED_17 = 17,
282 AIS_TYPE_RESERVED_18 = 18,
283 AIS_TYPE_RESERVED_19 = 19,
284 #[doc = "Wing In Ground effect."]
285 AIS_TYPE_WIG = 20,
286 AIS_TYPE_WIG_HAZARDOUS_A = 21,
287 AIS_TYPE_WIG_HAZARDOUS_B = 22,
288 AIS_TYPE_WIG_HAZARDOUS_C = 23,
289 AIS_TYPE_WIG_HAZARDOUS_D = 24,
290 AIS_TYPE_WIG_RESERVED_1 = 25,
291 AIS_TYPE_WIG_RESERVED_2 = 26,
292 AIS_TYPE_WIG_RESERVED_3 = 27,
293 AIS_TYPE_WIG_RESERVED_4 = 28,
294 AIS_TYPE_WIG_RESERVED_5 = 29,
295 AIS_TYPE_FISHING = 30,
296 AIS_TYPE_TOWING = 31,
297 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
298 AIS_TYPE_TOWING_LARGE = 32,
299 #[doc = "Dredging or other underwater ops."]
300 AIS_TYPE_DREDGING = 33,
301 AIS_TYPE_DIVING = 34,
302 AIS_TYPE_MILITARY = 35,
303 AIS_TYPE_SAILING = 36,
304 AIS_TYPE_PLEASURE = 37,
305 AIS_TYPE_RESERVED_20 = 38,
306 AIS_TYPE_RESERVED_21 = 39,
307 #[doc = "High Speed Craft."]
308 AIS_TYPE_HSC = 40,
309 AIS_TYPE_HSC_HAZARDOUS_A = 41,
310 AIS_TYPE_HSC_HAZARDOUS_B = 42,
311 AIS_TYPE_HSC_HAZARDOUS_C = 43,
312 AIS_TYPE_HSC_HAZARDOUS_D = 44,
313 AIS_TYPE_HSC_RESERVED_1 = 45,
314 AIS_TYPE_HSC_RESERVED_2 = 46,
315 AIS_TYPE_HSC_RESERVED_3 = 47,
316 AIS_TYPE_HSC_RESERVED_4 = 48,
317 AIS_TYPE_HSC_UNKNOWN = 49,
318 AIS_TYPE_PILOT = 50,
319 #[doc = "Search And Rescue vessel."]
320 AIS_TYPE_SAR = 51,
321 AIS_TYPE_TUG = 52,
322 AIS_TYPE_PORT_TENDER = 53,
323 #[doc = "Anti-pollution equipment."]
324 AIS_TYPE_ANTI_POLLUTION = 54,
325 AIS_TYPE_LAW_ENFORCEMENT = 55,
326 AIS_TYPE_SPARE_LOCAL_1 = 56,
327 AIS_TYPE_SPARE_LOCAL_2 = 57,
328 AIS_TYPE_MEDICAL_TRANSPORT = 58,
329 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
330 AIS_TYPE_NONECOMBATANT = 59,
331 AIS_TYPE_PASSENGER = 60,
332 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
333 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
334 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
335 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
336 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
337 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
338 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
339 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
340 AIS_TYPE_PASSENGER_UNKNOWN = 69,
341 AIS_TYPE_CARGO = 70,
342 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
343 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
344 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
345 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
346 AIS_TYPE_CARGO_RESERVED_1 = 75,
347 AIS_TYPE_CARGO_RESERVED_2 = 76,
348 AIS_TYPE_CARGO_RESERVED_3 = 77,
349 AIS_TYPE_CARGO_RESERVED_4 = 78,
350 AIS_TYPE_CARGO_UNKNOWN = 79,
351 AIS_TYPE_TANKER = 80,
352 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
353 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
354 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
355 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
356 AIS_TYPE_TANKER_RESERVED_1 = 85,
357 AIS_TYPE_TANKER_RESERVED_2 = 86,
358 AIS_TYPE_TANKER_RESERVED_3 = 87,
359 AIS_TYPE_TANKER_RESERVED_4 = 88,
360 AIS_TYPE_TANKER_UNKNOWN = 89,
361 AIS_TYPE_OTHER = 90,
362 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
363 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
364 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
365 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
366 AIS_TYPE_OTHER_RESERVED_1 = 95,
367 AIS_TYPE_OTHER_RESERVED_2 = 96,
368 AIS_TYPE_OTHER_RESERVED_3 = 97,
369 AIS_TYPE_OTHER_RESERVED_4 = 98,
370 AIS_TYPE_OTHER_UNKNOWN = 99,
371}
372impl AisType {
373 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
374}
375impl Default for AisType {
376 fn default() -> Self {
377 Self::DEFAULT
378 }
379}
380bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
381impl AttitudeTargetTypemask {
382 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
383}
384impl Default for AttitudeTargetTypemask {
385 fn default() -> Self {
386 Self::DEFAULT
387 }
388}
389#[cfg_attr(feature = "ts", derive(TS))]
390#[cfg_attr(feature = "ts", ts(export))]
391#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
392#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
393#[cfg_attr(feature = "serde", serde(tag = "type"))]
394#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
395#[repr(u32)]
396#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
397pub enum AutotuneAxis {
398 #[doc = "Autotune roll axis."]
399 AUTOTUNE_AXIS_ROLL = 1,
400 #[doc = "Autotune pitch axis."]
401 AUTOTUNE_AXIS_PITCH = 2,
402 #[doc = "Autotune yaw axis."]
403 AUTOTUNE_AXIS_YAW = 4,
404}
405impl AutotuneAxis {
406 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
407}
408impl Default for AutotuneAxis {
409 fn default() -> Self {
410 Self::DEFAULT
411 }
412}
413bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
414impl CameraCapFlags {
415 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
416}
417impl Default for CameraCapFlags {
418 fn default() -> Self {
419 Self::DEFAULT
420 }
421}
422#[cfg_attr(feature = "ts", derive(TS))]
423#[cfg_attr(feature = "ts", ts(export))]
424#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
425#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
426#[cfg_attr(feature = "serde", serde(tag = "type"))]
427#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
428#[repr(u32)]
429#[doc = "Camera Modes."]
430pub enum CameraMode {
431 #[doc = "Camera is in image/photo capture mode."]
432 CAMERA_MODE_IMAGE = 0,
433 #[doc = "Camera is in video capture mode."]
434 CAMERA_MODE_VIDEO = 1,
435 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
436 CAMERA_MODE_IMAGE_SURVEY = 2,
437}
438impl CameraMode {
439 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
440}
441impl Default for CameraMode {
442 fn default() -> Self {
443 Self::DEFAULT
444 }
445}
446#[cfg_attr(feature = "ts", derive(TS))]
447#[cfg_attr(feature = "ts", ts(export))]
448#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
449#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
450#[cfg_attr(feature = "serde", serde(tag = "type"))]
451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
452#[repr(u32)]
453#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
454pub enum CameraSource {
455 #[doc = "Default camera source."]
456 CAMERA_SOURCE_DEFAULT = 0,
457 #[doc = "RGB camera source."]
458 CAMERA_SOURCE_RGB = 1,
459 #[doc = "IR camera source."]
460 CAMERA_SOURCE_IR = 2,
461 #[doc = "NDVI camera source."]
462 CAMERA_SOURCE_NDVI = 3,
463}
464impl CameraSource {
465 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
466}
467impl Default for CameraSource {
468 fn default() -> Self {
469 Self::DEFAULT
470 }
471}
472#[cfg_attr(feature = "ts", derive(TS))]
473#[cfg_attr(feature = "ts", ts(export))]
474#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
476#[cfg_attr(feature = "serde", serde(tag = "type"))]
477#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
478#[repr(u32)]
479#[doc = "Camera tracking modes"]
480pub enum CameraTrackingMode {
481 #[doc = "Not tracking"]
482 CAMERA_TRACKING_MODE_NONE = 0,
483 #[doc = "Target is a point"]
484 CAMERA_TRACKING_MODE_POINT = 1,
485 #[doc = "Target is a rectangle"]
486 CAMERA_TRACKING_MODE_RECTANGLE = 2,
487}
488impl CameraTrackingMode {
489 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
490}
491impl Default for CameraTrackingMode {
492 fn default() -> Self {
493 Self::DEFAULT
494 }
495}
496#[cfg_attr(feature = "ts", derive(TS))]
497#[cfg_attr(feature = "ts", ts(export))]
498#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
499#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
500#[cfg_attr(feature = "serde", serde(tag = "type"))]
501#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
502#[repr(u32)]
503#[doc = "Camera tracking status flags"]
504pub enum CameraTrackingStatusFlags {
505 #[doc = "Camera is not tracking"]
506 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
507 #[doc = "Camera is tracking"]
508 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
509 #[doc = "Camera tracking in error state"]
510 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
511}
512impl CameraTrackingStatusFlags {
513 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
514}
515impl Default for CameraTrackingStatusFlags {
516 fn default() -> Self {
517 Self::DEFAULT
518 }
519}
520bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
521impl CameraTrackingTargetData {
522 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
523}
524impl Default for CameraTrackingTargetData {
525 fn default() -> Self {
526 Self::DEFAULT
527 }
528}
529#[cfg_attr(feature = "ts", derive(TS))]
530#[cfg_attr(feature = "ts", ts(export))]
531#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
532#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
533#[cfg_attr(feature = "serde", serde(tag = "type"))]
534#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
535#[repr(u32)]
536#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
537pub enum CameraZoomType {
538 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
539 ZOOM_TYPE_STEP = 0,
540 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
541 ZOOM_TYPE_CONTINUOUS = 1,
542 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
543 ZOOM_TYPE_RANGE = 2,
544 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
545 ZOOM_TYPE_FOCAL_LENGTH = 3,
546 #[doc = "Zoom value as horizontal field of view in degrees."]
547 ZOOM_TYPE_HORIZONTAL_FOV = 4,
548}
549impl CameraZoomType {
550 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
551}
552impl Default for CameraZoomType {
553 fn default() -> Self {
554 Self::DEFAULT
555 }
556}
557#[cfg_attr(feature = "ts", derive(TS))]
558#[cfg_attr(feature = "ts", ts(export))]
559#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
560#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
561#[cfg_attr(feature = "serde", serde(tag = "type"))]
562#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
563#[repr(u32)]
564pub enum CanFilterOp {
565 CAN_FILTER_REPLACE = 0,
566 CAN_FILTER_ADD = 1,
567 CAN_FILTER_REMOVE = 2,
568}
569impl CanFilterOp {
570 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
571}
572impl Default for CanFilterOp {
573 fn default() -> Self {
574 Self::DEFAULT
575 }
576}
577#[cfg_attr(feature = "ts", derive(TS))]
578#[cfg_attr(feature = "ts", ts(export))]
579#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
580#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
581#[cfg_attr(feature = "serde", serde(tag = "type"))]
582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
583#[repr(u32)]
584#[doc = "Possible responses from a CELLULAR_CONFIG message."]
585pub enum CellularConfigResponse {
586 #[doc = "Changes accepted."]
587 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
588 #[doc = "Invalid APN."]
589 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
590 #[doc = "Invalid PIN."]
591 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
592 #[doc = "Changes rejected."]
593 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
594 #[doc = "PUK is required to unblock SIM card."]
595 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
596}
597impl CellularConfigResponse {
598 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
599}
600impl Default for CellularConfigResponse {
601 fn default() -> Self {
602 Self::DEFAULT
603 }
604}
605#[cfg_attr(feature = "ts", derive(TS))]
606#[cfg_attr(feature = "ts", ts(export))]
607#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
609#[cfg_attr(feature = "serde", serde(tag = "type"))]
610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
611#[repr(u32)]
612#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
613pub enum CellularNetworkFailedReason {
614 #[doc = "No error"]
615 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
616 #[doc = "Error state is unknown"]
617 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
618 #[doc = "SIM is required for the modem but missing"]
619 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
620 #[doc = "SIM is available, but not usable for connection"]
621 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
622}
623impl CellularNetworkFailedReason {
624 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
625}
626impl Default for CellularNetworkFailedReason {
627 fn default() -> Self {
628 Self::DEFAULT
629 }
630}
631#[cfg_attr(feature = "ts", derive(TS))]
632#[cfg_attr(feature = "ts", ts(export))]
633#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
635#[cfg_attr(feature = "serde", serde(tag = "type"))]
636#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
637#[repr(u32)]
638#[doc = "Cellular network radio type"]
639pub enum CellularNetworkRadioType {
640 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
641 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
642 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
643 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
644 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
645}
646impl CellularNetworkRadioType {
647 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
648}
649impl Default for CellularNetworkRadioType {
650 fn default() -> Self {
651 Self::DEFAULT
652 }
653}
654#[cfg_attr(feature = "ts", derive(TS))]
655#[cfg_attr(feature = "ts", ts(export))]
656#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
658#[cfg_attr(feature = "serde", serde(tag = "type"))]
659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
660#[repr(u32)]
661#[doc = "These flags encode the cellular network status"]
662pub enum CellularStatusFlag {
663 #[doc = "State unknown or not reportable."]
664 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
665 #[doc = "Modem is unusable"]
666 CELLULAR_STATUS_FLAG_FAILED = 1,
667 #[doc = "Modem is being initialized"]
668 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
669 #[doc = "Modem is locked"]
670 CELLULAR_STATUS_FLAG_LOCKED = 3,
671 #[doc = "Modem is not enabled and is powered down"]
672 CELLULAR_STATUS_FLAG_DISABLED = 4,
673 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
674 CELLULAR_STATUS_FLAG_DISABLING = 5,
675 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
676 CELLULAR_STATUS_FLAG_ENABLING = 6,
677 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
678 CELLULAR_STATUS_FLAG_ENABLED = 7,
679 #[doc = "Modem is searching for a network provider to register"]
680 CELLULAR_STATUS_FLAG_SEARCHING = 8,
681 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
682 CELLULAR_STATUS_FLAG_REGISTERED = 9,
683 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
684 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
685 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
686 CELLULAR_STATUS_FLAG_CONNECTING = 11,
687 #[doc = "One or more packet data bearers is active and connected"]
688 CELLULAR_STATUS_FLAG_CONNECTED = 12,
689}
690impl CellularStatusFlag {
691 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
692}
693impl Default for CellularStatusFlag {
694 fn default() -> Self {
695 Self::DEFAULT
696 }
697}
698#[cfg_attr(feature = "ts", derive(TS))]
699#[cfg_attr(feature = "ts", ts(export))]
700#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
702#[cfg_attr(feature = "serde", serde(tag = "type"))]
703#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
704#[repr(u32)]
705#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
706pub enum CompMetadataType {
707 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
708 COMP_METADATA_TYPE_GENERAL = 0,
709 #[doc = "Parameter meta data."]
710 COMP_METADATA_TYPE_PARAMETER = 1,
711 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
712 COMP_METADATA_TYPE_COMMANDS = 2,
713 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
714 COMP_METADATA_TYPE_PERIPHERALS = 3,
715 #[doc = "Meta data for the events interface."]
716 COMP_METADATA_TYPE_EVENTS = 4,
717 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
718 COMP_METADATA_TYPE_ACTUATORS = 5,
719}
720impl CompMetadataType {
721 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
722}
723impl Default for CompMetadataType {
724 fn default() -> Self {
725 Self::DEFAULT
726 }
727}
728#[cfg_attr(feature = "ts", derive(TS))]
729#[cfg_attr(feature = "ts", ts(export))]
730#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
732#[cfg_attr(feature = "serde", serde(tag = "type"))]
733#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
734#[repr(u32)]
735#[doc = "Indicates the ESC connection type."]
736pub enum EscConnectionType {
737 #[doc = "Traditional PPM ESC."]
738 ESC_CONNECTION_TYPE_PPM = 0,
739 #[doc = "Serial Bus connected ESC."]
740 ESC_CONNECTION_TYPE_SERIAL = 1,
741 #[doc = "One Shot PPM ESC."]
742 ESC_CONNECTION_TYPE_ONESHOT = 2,
743 #[doc = "I2C ESC."]
744 ESC_CONNECTION_TYPE_I2C = 3,
745 #[doc = "CAN-Bus ESC."]
746 ESC_CONNECTION_TYPE_CAN = 4,
747 #[doc = "DShot ESC."]
748 ESC_CONNECTION_TYPE_DSHOT = 5,
749}
750impl EscConnectionType {
751 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
752}
753impl Default for EscConnectionType {
754 fn default() -> Self {
755 Self::DEFAULT
756 }
757}
758bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
759impl EscFailureFlags {
760 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
761}
762impl Default for EscFailureFlags {
763 fn default() -> Self {
764 Self::DEFAULT
765 }
766}
767bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
768impl EstimatorStatusFlags {
769 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
770}
771impl Default for EstimatorStatusFlags {
772 fn default() -> Self {
773 Self::DEFAULT
774 }
775}
776#[cfg_attr(feature = "ts", derive(TS))]
777#[cfg_attr(feature = "ts", ts(export))]
778#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
780#[cfg_attr(feature = "serde", serde(tag = "type"))]
781#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
782#[repr(u32)]
783#[doc = "List of possible failure type to inject."]
784pub enum FailureType {
785 #[doc = "No failure injected, used to reset a previous failure."]
786 FAILURE_TYPE_OK = 0,
787 #[doc = "Sets unit off, so completely non-responsive."]
788 FAILURE_TYPE_OFF = 1,
789 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
790 FAILURE_TYPE_STUCK = 2,
791 #[doc = "Unit is reporting complete garbage."]
792 FAILURE_TYPE_GARBAGE = 3,
793 #[doc = "Unit is consistently wrong."]
794 FAILURE_TYPE_WRONG = 4,
795 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
796 FAILURE_TYPE_SLOW = 5,
797 #[doc = "Data of unit is delayed in time."]
798 FAILURE_TYPE_DELAYED = 6,
799 #[doc = "Unit is sometimes working, sometimes not."]
800 FAILURE_TYPE_INTERMITTENT = 7,
801}
802impl FailureType {
803 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
804}
805impl Default for FailureType {
806 fn default() -> Self {
807 Self::DEFAULT
808 }
809}
810#[cfg_attr(feature = "ts", derive(TS))]
811#[cfg_attr(feature = "ts", ts(export))]
812#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
813#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
814#[cfg_attr(feature = "serde", serde(tag = "type"))]
815#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
816#[repr(u32)]
817#[doc = "List of possible units where failures can be injected."]
818pub enum FailureUnit {
819 FAILURE_UNIT_SENSOR_GYRO = 0,
820 FAILURE_UNIT_SENSOR_ACCEL = 1,
821 FAILURE_UNIT_SENSOR_MAG = 2,
822 FAILURE_UNIT_SENSOR_BARO = 3,
823 FAILURE_UNIT_SENSOR_GPS = 4,
824 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
825 FAILURE_UNIT_SENSOR_VIO = 6,
826 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
827 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
828 FAILURE_UNIT_SYSTEM_BATTERY = 100,
829 FAILURE_UNIT_SYSTEM_MOTOR = 101,
830 FAILURE_UNIT_SYSTEM_SERVO = 102,
831 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
832 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
833 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
834}
835impl FailureUnit {
836 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
837}
838impl Default for FailureUnit {
839 fn default() -> Self {
840 Self::DEFAULT
841 }
842}
843#[cfg_attr(feature = "ts", derive(TS))]
844#[cfg_attr(feature = "ts", ts(export))]
845#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
847#[cfg_attr(feature = "serde", serde(tag = "type"))]
848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
849#[repr(u32)]
850pub enum FenceBreach {
851 #[doc = "No last fence breach"]
852 FENCE_BREACH_NONE = 0,
853 #[doc = "Breached minimum altitude"]
854 FENCE_BREACH_MINALT = 1,
855 #[doc = "Breached maximum altitude"]
856 FENCE_BREACH_MAXALT = 2,
857 #[doc = "Breached fence boundary"]
858 FENCE_BREACH_BOUNDARY = 3,
859}
860impl FenceBreach {
861 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
862}
863impl Default for FenceBreach {
864 fn default() -> Self {
865 Self::DEFAULT
866 }
867}
868#[cfg_attr(feature = "ts", derive(TS))]
869#[cfg_attr(feature = "ts", ts(export))]
870#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
871#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
872#[cfg_attr(feature = "serde", serde(tag = "type"))]
873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
874#[repr(u32)]
875#[doc = "Actions being taken to mitigate/prevent fence breach"]
876pub enum FenceMitigate {
877 #[doc = "Unknown"]
878 FENCE_MITIGATE_UNKNOWN = 0,
879 #[doc = "No actions being taken"]
880 FENCE_MITIGATE_NONE = 1,
881 #[doc = "Velocity limiting active to prevent breach"]
882 FENCE_MITIGATE_VEL_LIMIT = 2,
883}
884impl FenceMitigate {
885 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
886}
887impl Default for FenceMitigate {
888 fn default() -> Self {
889 Self::DEFAULT
890 }
891}
892#[cfg_attr(feature = "ts", derive(TS))]
893#[cfg_attr(feature = "ts", ts(export))]
894#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
895#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
896#[cfg_attr(feature = "serde", serde(tag = "type"))]
897#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
898#[repr(u32)]
899#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
900pub enum FenceType {
901 #[doc = "Maximum altitude fence"]
902 FENCE_TYPE_ALT_MAX = 1,
903 #[doc = "Circle fence"]
904 FENCE_TYPE_CIRCLE = 2,
905 #[doc = "Polygon fence"]
906 FENCE_TYPE_POLYGON = 4,
907 #[doc = "Minimum altitude fence"]
908 FENCE_TYPE_ALT_MIN = 8,
909}
910impl FenceType {
911 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
912}
913impl Default for FenceType {
914 fn default() -> Self {
915 Self::DEFAULT
916 }
917}
918#[cfg_attr(feature = "ts", derive(TS))]
919#[cfg_attr(feature = "ts", ts(export))]
920#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
922#[cfg_attr(feature = "serde", serde(tag = "type"))]
923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
924#[repr(u32)]
925#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
926pub enum FirmwareVersionType {
927 #[doc = "development release"]
928 FIRMWARE_VERSION_TYPE_DEV = 0,
929 #[doc = "alpha release"]
930 FIRMWARE_VERSION_TYPE_ALPHA = 64,
931 #[doc = "beta release"]
932 FIRMWARE_VERSION_TYPE_BETA = 128,
933 #[doc = "release candidate"]
934 FIRMWARE_VERSION_TYPE_RC = 192,
935 #[doc = "official stable release"]
936 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
937}
938impl FirmwareVersionType {
939 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
940}
941impl Default for FirmwareVersionType {
942 fn default() -> Self {
943 Self::DEFAULT
944 }
945}
946bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
947impl GimbalDeviceCapFlags {
948 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
949}
950impl Default for GimbalDeviceCapFlags {
951 fn default() -> Self {
952 Self::DEFAULT
953 }
954}
955bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
956impl GimbalDeviceErrorFlags {
957 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
958}
959impl Default for GimbalDeviceErrorFlags {
960 fn default() -> Self {
961 Self::DEFAULT
962 }
963}
964bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
965impl GimbalDeviceFlags {
966 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
967}
968impl Default for GimbalDeviceFlags {
969 fn default() -> Self {
970 Self::DEFAULT
971 }
972}
973bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
974impl GimbalManagerCapFlags {
975 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
976}
977impl Default for GimbalManagerCapFlags {
978 fn default() -> Self {
979 Self::DEFAULT
980 }
981}
982bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
983impl GimbalManagerFlags {
984 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
985}
986impl Default for GimbalManagerFlags {
987 fn default() -> Self {
988 Self::DEFAULT
989 }
990}
991#[cfg_attr(feature = "ts", derive(TS))]
992#[cfg_attr(feature = "ts", ts(export))]
993#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
995#[cfg_attr(feature = "serde", serde(tag = "type"))]
996#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
997#[repr(u32)]
998#[doc = "Type of GPS fix"]
999pub enum GpsFixType {
1000 #[doc = "No GPS connected"]
1001 GPS_FIX_TYPE_NO_GPS = 0,
1002 #[doc = "No position information, GPS is connected"]
1003 GPS_FIX_TYPE_NO_FIX = 1,
1004 #[doc = "2D position"]
1005 GPS_FIX_TYPE_2D_FIX = 2,
1006 #[doc = "3D position"]
1007 GPS_FIX_TYPE_3D_FIX = 3,
1008 #[doc = "DGPS/SBAS aided 3D position"]
1009 GPS_FIX_TYPE_DGPS = 4,
1010 #[doc = "RTK float, 3D position"]
1011 GPS_FIX_TYPE_RTK_FLOAT = 5,
1012 #[doc = "RTK Fixed, 3D position"]
1013 GPS_FIX_TYPE_RTK_FIXED = 6,
1014 #[doc = "Static fixed, typically used for base stations"]
1015 GPS_FIX_TYPE_STATIC = 7,
1016 #[doc = "PPP, 3D position."]
1017 GPS_FIX_TYPE_PPP = 8,
1018}
1019impl GpsFixType {
1020 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1021}
1022impl Default for GpsFixType {
1023 fn default() -> Self {
1024 Self::DEFAULT
1025 }
1026}
1027bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1028impl GpsInputIgnoreFlags {
1029 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1030}
1031impl Default for GpsInputIgnoreFlags {
1032 fn default() -> Self {
1033 Self::DEFAULT
1034 }
1035}
1036#[cfg_attr(feature = "ts", derive(TS))]
1037#[cfg_attr(feature = "ts", ts(export))]
1038#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1039#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1040#[cfg_attr(feature = "serde", serde(tag = "type"))]
1041#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1042#[repr(u32)]
1043#[doc = "Gripper actions."]
1044pub enum GripperActions {
1045 #[doc = "Gripper release cargo."]
1046 GRIPPER_ACTION_RELEASE = 0,
1047 #[doc = "Gripper grab onto cargo."]
1048 GRIPPER_ACTION_GRAB = 1,
1049}
1050impl GripperActions {
1051 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1052}
1053impl Default for GripperActions {
1054 fn default() -> Self {
1055 Self::DEFAULT
1056 }
1057}
1058bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1059impl HighresImuUpdatedFlags {
1060 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1061}
1062impl Default for HighresImuUpdatedFlags {
1063 fn default() -> Self {
1064 Self::DEFAULT
1065 }
1066}
1067bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1068impl HilActuatorControlsFlags {
1069 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1070}
1071impl Default for HilActuatorControlsFlags {
1072 fn default() -> Self {
1073 Self::DEFAULT
1074 }
1075}
1076bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1077impl HilSensorUpdatedFlags {
1078 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1079}
1080impl Default for HilSensorUpdatedFlags {
1081 fn default() -> Self {
1082 Self::DEFAULT
1083 }
1084}
1085bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1086impl HlFailureFlag {
1087 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1088}
1089impl Default for HlFailureFlag {
1090 fn default() -> Self {
1091 Self::DEFAULT
1092 }
1093}
1094bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1095impl IlluminatorErrorFlags {
1096 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1097}
1098impl Default for IlluminatorErrorFlags {
1099 fn default() -> Self {
1100 Self::DEFAULT
1101 }
1102}
1103#[cfg_attr(feature = "ts", derive(TS))]
1104#[cfg_attr(feature = "ts", ts(export))]
1105#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1106#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1107#[cfg_attr(feature = "serde", serde(tag = "type"))]
1108#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1109#[repr(u32)]
1110#[doc = "Modes of illuminator"]
1111pub enum IlluminatorMode {
1112 #[doc = "Illuminator mode is not specified/unknown"]
1113 ILLUMINATOR_MODE_UNKNOWN = 0,
1114 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1115 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1116 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1117 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1118}
1119impl IlluminatorMode {
1120 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1121}
1122impl Default for IlluminatorMode {
1123 fn default() -> Self {
1124 Self::DEFAULT
1125 }
1126}
1127#[cfg_attr(feature = "ts", derive(TS))]
1128#[cfg_attr(feature = "ts", ts(export))]
1129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1131#[cfg_attr(feature = "serde", serde(tag = "type"))]
1132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1133#[repr(u32)]
1134#[doc = "Type of landing target"]
1135pub enum LandingTargetType {
1136 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1137 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1138 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1139 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1140 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1141 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1142 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1143 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1144}
1145impl LandingTargetType {
1146 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1147}
1148impl Default for LandingTargetType {
1149 fn default() -> Self {
1150 Self::DEFAULT
1151 }
1152}
1153#[cfg_attr(feature = "ts", derive(TS))]
1154#[cfg_attr(feature = "ts", ts(export))]
1155#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1156#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1157#[cfg_attr(feature = "serde", serde(tag = "type"))]
1158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1159#[repr(u32)]
1160pub enum MagCalStatus {
1161 MAG_CAL_NOT_STARTED = 0,
1162 MAG_CAL_WAITING_TO_START = 1,
1163 MAG_CAL_RUNNING_STEP_ONE = 2,
1164 MAG_CAL_RUNNING_STEP_TWO = 3,
1165 MAG_CAL_SUCCESS = 4,
1166 MAG_CAL_FAILED = 5,
1167 MAG_CAL_BAD_ORIENTATION = 6,
1168 MAG_CAL_BAD_RADIUS = 7,
1169}
1170impl MagCalStatus {
1171 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1172}
1173impl Default for MagCalStatus {
1174 fn default() -> Self {
1175 Self::DEFAULT
1176 }
1177}
1178#[cfg_attr(feature = "ts", derive(TS))]
1179#[cfg_attr(feature = "ts", ts(export))]
1180#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1181#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1182#[cfg_attr(feature = "serde", serde(tag = "type"))]
1183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1184#[repr(u32)]
1185pub enum MavArmAuthDeniedReason {
1186 #[doc = "Not a specific reason"]
1187 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1188 #[doc = "Authorizer will send the error as string to GCS"]
1189 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1190 #[doc = "At least one waypoint have a invalid value"]
1191 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1192 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1193 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1194 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1195 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1196 #[doc = "Weather is not good to fly"]
1197 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1198}
1199impl MavArmAuthDeniedReason {
1200 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1201}
1202impl Default for MavArmAuthDeniedReason {
1203 fn default() -> Self {
1204 Self::DEFAULT
1205 }
1206}
1207#[cfg_attr(feature = "ts", derive(TS))]
1208#[cfg_attr(feature = "ts", ts(export))]
1209#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1210#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1211#[cfg_attr(feature = "serde", serde(tag = "type"))]
1212#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1213#[repr(u32)]
1214#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1215pub enum MavAutopilot {
1216 #[doc = "Generic autopilot, full support for everything"]
1217 MAV_AUTOPILOT_GENERIC = 0,
1218 #[doc = "Reserved for future use."]
1219 MAV_AUTOPILOT_RESERVED = 1,
1220 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1221 MAV_AUTOPILOT_SLUGS = 2,
1222 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1223 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1224 #[doc = "OpenPilot, <http://openpilot.org>"]
1225 MAV_AUTOPILOT_OPENPILOT = 4,
1226 #[doc = "Generic autopilot only supporting simple waypoints"]
1227 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1228 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1229 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1230 #[doc = "Generic autopilot supporting the full mission command set"]
1231 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1232 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1233 MAV_AUTOPILOT_INVALID = 8,
1234 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1235 MAV_AUTOPILOT_PPZ = 9,
1236 #[doc = "UAV Dev Board"]
1237 MAV_AUTOPILOT_UDB = 10,
1238 #[doc = "FlexiPilot"]
1239 MAV_AUTOPILOT_FP = 11,
1240 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1241 MAV_AUTOPILOT_PX4 = 12,
1242 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1243 MAV_AUTOPILOT_SMACCMPILOT = 13,
1244 #[doc = "AutoQuad -- <http://autoquad.org>"]
1245 MAV_AUTOPILOT_AUTOQUAD = 14,
1246 #[doc = "Armazila -- <http://armazila.com>"]
1247 MAV_AUTOPILOT_ARMAZILA = 15,
1248 #[doc = "Aerob -- <http://aerob.ru>"]
1249 MAV_AUTOPILOT_AEROB = 16,
1250 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1251 MAV_AUTOPILOT_ASLUAV = 17,
1252 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1253 MAV_AUTOPILOT_SMARTAP = 18,
1254 #[doc = "AirRails - <http://uaventure.com>"]
1255 MAV_AUTOPILOT_AIRRAILS = 19,
1256 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1257 MAV_AUTOPILOT_REFLEX = 20,
1258}
1259impl MavAutopilot {
1260 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1261}
1262impl Default for MavAutopilot {
1263 fn default() -> Self {
1264 Self::DEFAULT
1265 }
1266}
1267#[cfg_attr(feature = "ts", derive(TS))]
1268#[cfg_attr(feature = "ts", ts(export))]
1269#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1271#[cfg_attr(feature = "serde", serde(tag = "type"))]
1272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1273#[repr(u32)]
1274#[doc = "Enumeration for battery charge states."]
1275pub enum MavBatteryChargeState {
1276 #[doc = "Low battery state is not provided"]
1277 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1278 #[doc = "Battery is not in low state. Normal operation."]
1279 MAV_BATTERY_CHARGE_STATE_OK = 1,
1280 #[doc = "Battery state is low, warn and monitor close."]
1281 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1282 #[doc = "Battery state is critical, return or abort immediately."]
1283 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1284 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1285 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1286 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1287 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1288 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1289 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1290 #[doc = "Battery is charging."]
1291 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1292}
1293impl MavBatteryChargeState {
1294 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1295}
1296impl Default for MavBatteryChargeState {
1297 fn default() -> Self {
1298 Self::DEFAULT
1299 }
1300}
1301bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1302impl MavBatteryFault {
1303 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1304}
1305impl Default for MavBatteryFault {
1306 fn default() -> Self {
1307 Self::DEFAULT
1308 }
1309}
1310#[cfg_attr(feature = "ts", derive(TS))]
1311#[cfg_attr(feature = "ts", ts(export))]
1312#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1314#[cfg_attr(feature = "serde", serde(tag = "type"))]
1315#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1316#[repr(u32)]
1317#[doc = "Enumeration of battery functions"]
1318pub enum MavBatteryFunction {
1319 #[doc = "Battery function is unknown"]
1320 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1321 #[doc = "Battery supports all flight systems"]
1322 MAV_BATTERY_FUNCTION_ALL = 1,
1323 #[doc = "Battery for the propulsion system"]
1324 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1325 #[doc = "Avionics battery"]
1326 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1327 #[doc = "Payload battery"]
1328 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1329}
1330impl MavBatteryFunction {
1331 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1332}
1333impl Default for MavBatteryFunction {
1334 fn default() -> Self {
1335 Self::DEFAULT
1336 }
1337}
1338#[cfg_attr(feature = "ts", derive(TS))]
1339#[cfg_attr(feature = "ts", ts(export))]
1340#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1342#[cfg_attr(feature = "serde", serde(tag = "type"))]
1343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1344#[repr(u32)]
1345#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1346pub enum MavBatteryMode {
1347 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1348 MAV_BATTERY_MODE_UNKNOWN = 0,
1349 #[doc = "Battery is auto discharging (towards storage level)."]
1350 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1351 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1352 MAV_BATTERY_MODE_HOT_SWAP = 2,
1353}
1354impl MavBatteryMode {
1355 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1356}
1357impl Default for MavBatteryMode {
1358 fn default() -> Self {
1359 Self::DEFAULT
1360 }
1361}
1362#[cfg_attr(feature = "ts", derive(TS))]
1363#[cfg_attr(feature = "ts", ts(export))]
1364#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1366#[cfg_attr(feature = "serde", serde(tag = "type"))]
1367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1368#[repr(u32)]
1369#[doc = "Enumeration of battery types"]
1370pub enum MavBatteryType {
1371 #[doc = "Not specified."]
1372 MAV_BATTERY_TYPE_UNKNOWN = 0,
1373 #[doc = "Lithium polymer battery"]
1374 MAV_BATTERY_TYPE_LIPO = 1,
1375 #[doc = "Lithium-iron-phosphate battery"]
1376 MAV_BATTERY_TYPE_LIFE = 2,
1377 #[doc = "Lithium-ION battery"]
1378 MAV_BATTERY_TYPE_LION = 3,
1379 #[doc = "Nickel metal hydride battery"]
1380 MAV_BATTERY_TYPE_NIMH = 4,
1381}
1382impl MavBatteryType {
1383 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1384}
1385impl Default for MavBatteryType {
1386 fn default() -> Self {
1387 Self::DEFAULT
1388 }
1389}
1390#[cfg_attr(feature = "ts", derive(TS))]
1391#[cfg_attr(feature = "ts", ts(export))]
1392#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1393#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1394#[cfg_attr(feature = "serde", serde(tag = "type"))]
1395#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1396#[repr(u32)]
1397#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1398pub enum MavCmd {
1399 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1400 MAV_CMD_NAV_WAYPOINT = 16,
1401 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1402 MAV_CMD_NAV_LOITER_UNLIM = 17,
1403 #[doc = "Loiter around this waypoint for X turns"]
1404 MAV_CMD_NAV_LOITER_TURNS = 18,
1405 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1406 MAV_CMD_NAV_LOITER_TIME = 19,
1407 #[doc = "Return to launch location"]
1408 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1409 #[doc = "Land at location."]
1410 MAV_CMD_NAV_LAND = 21,
1411 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1412 MAV_CMD_NAV_TAKEOFF = 22,
1413 #[doc = "Land at local position (local frame only)"]
1414 MAV_CMD_NAV_LAND_LOCAL = 23,
1415 #[doc = "Takeoff from local position (local frame only)"]
1416 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1417 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1418 MAV_CMD_NAV_FOLLOW = 25,
1419 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1420 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1421 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1422 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1423 #[doc = "Begin following a target"]
1424 MAV_CMD_DO_FOLLOW = 32,
1425 #[doc = "Reposition the MAV after a follow target command has been sent"]
1426 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1427 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1428 MAV_CMD_DO_ORBIT = 34,
1429 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1430 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1431 MAV_CMD_NAV_ROI = 80,
1432 #[doc = "Control autonomous path planning on the MAV."]
1433 MAV_CMD_NAV_PATHPLANNING = 81,
1434 #[doc = "Navigate to waypoint using a spline path."]
1435 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1436 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1437 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1438 #[doc = "Land using VTOL mode"]
1439 MAV_CMD_NAV_VTOL_LAND = 85,
1440 #[doc = "hand control over to an external controller"]
1441 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1442 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1443 MAV_CMD_NAV_DELAY = 93,
1444 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1445 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1446 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1447 MAV_CMD_NAV_LAST = 95,
1448 #[doc = "Delay mission state machine."]
1449 MAV_CMD_CONDITION_DELAY = 112,
1450 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1451 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1452 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1453 MAV_CMD_CONDITION_DISTANCE = 114,
1454 #[doc = "Reach a certain target angle."]
1455 MAV_CMD_CONDITION_YAW = 115,
1456 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1457 MAV_CMD_CONDITION_LAST = 159,
1458 #[doc = "Set system mode."]
1459 MAV_CMD_DO_SET_MODE = 176,
1460 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1461 MAV_CMD_DO_JUMP = 177,
1462 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1463 MAV_CMD_DO_CHANGE_SPEED = 178,
1464 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1465 MAV_CMD_DO_SET_HOME = 179,
1466 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1467 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1468 MAV_CMD_DO_SET_PARAMETER = 180,
1469 #[doc = "Set a relay to a condition."]
1470 MAV_CMD_DO_SET_RELAY = 181,
1471 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1472 MAV_CMD_DO_REPEAT_RELAY = 182,
1473 #[doc = "Set a servo to a desired PWM value."]
1474 MAV_CMD_DO_SET_SERVO = 183,
1475 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1476 MAV_CMD_DO_REPEAT_SERVO = 184,
1477 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1478 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1479 #[doc = "Change altitude set point."]
1480 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1481 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1482 MAV_CMD_DO_SET_ACTUATOR = 187,
1483 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1484 MAV_CMD_DO_RETURN_PATH_START = 188,
1485 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1486 MAV_CMD_DO_LAND_START = 189,
1487 #[doc = "Mission command to perform a landing from a rally point."]
1488 MAV_CMD_DO_RALLY_LAND = 190,
1489 #[doc = "Mission command to safely abort an autonomous landing."]
1490 MAV_CMD_DO_GO_AROUND = 191,
1491 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1492 MAV_CMD_DO_REPOSITION = 192,
1493 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1494 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1495 #[doc = "Set moving direction to forward or reverse."]
1496 MAV_CMD_DO_SET_REVERSE = 194,
1497 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1498 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1499 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1500 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1501 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1502 MAV_CMD_DO_SET_ROI_NONE = 197,
1503 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1504 MAV_CMD_DO_SET_ROI_SYSID = 198,
1505 #[doc = "Control onboard camera system."]
1506 MAV_CMD_DO_CONTROL_VIDEO = 200,
1507 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1508 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1509 MAV_CMD_DO_SET_ROI = 201,
1510 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1511 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1512 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1513 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1514 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1515 #[doc = "Mission command to configure a camera or antenna mount"]
1516 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1517 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1518 #[doc = "Mission command to control a camera or antenna mount"]
1519 MAV_CMD_DO_MOUNT_CONTROL = 205,
1520 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1521 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1522 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1523 MAV_CMD_DO_FENCE_ENABLE = 207,
1524 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1525 MAV_CMD_DO_PARACHUTE = 208,
1526 #[doc = "Command to perform motor test."]
1527 MAV_CMD_DO_MOTOR_TEST = 209,
1528 #[doc = "Change to/from inverted flight."]
1529 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1530 #[doc = "Mission command to operate a gripper."]
1531 MAV_CMD_DO_GRIPPER = 211,
1532 #[doc = "Enable/disable autotune."]
1533 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1534 #[doc = "Sets a desired vehicle turn angle and speed change."]
1535 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1536 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1537 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1538 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1539 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1540 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1541 #[doc = "set id of master controller"]
1542 MAV_CMD_DO_GUIDED_MASTER = 221,
1543 #[doc = "Set limits for external control"]
1544 MAV_CMD_DO_GUIDED_LIMITS = 222,
1545 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1546 MAV_CMD_DO_ENGINE_CONTROL = 223,
1547 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1548 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1549 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1550 MAV_CMD_DO_LAST = 240,
1551 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1552 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1553 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1554 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1555 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1556 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1557 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1558 MAV_CMD_PREFLIGHT_STORAGE = 245,
1559 #[doc = "Request the reboot or shutdown of system components."]
1560 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1561 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1562 MAV_CMD_OVERRIDE_GOTO = 252,
1563 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1564 MAV_CMD_OBLIQUE_SURVEY = 260,
1565 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1566 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1567 #[doc = "start running a mission"]
1568 MAV_CMD_MISSION_START = 300,
1569 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1570 MAV_CMD_ACTUATOR_TEST = 310,
1571 #[doc = "Actuator configuration command."]
1572 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1573 #[doc = "Arms / Disarms a component"]
1574 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1575 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1576 MAV_CMD_RUN_PREARM_CHECKS = 401,
1577 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1578 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1579 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1580 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1581 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1582 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1583 MAV_CMD_GET_HOME_POSITION = 410,
1584 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1585 MAV_CMD_INJECT_FAILURE = 420,
1586 #[doc = "Starts receiver pairing."]
1587 MAV_CMD_START_RX_PAIR = 500,
1588 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1589 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1590 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1591 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1592 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1593 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1594 MAV_CMD_REQUEST_MESSAGE = 512,
1595 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1596 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1597 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1598 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1599 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1600 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1601 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1602 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1603 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1604 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1605 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1606 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1607 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1608 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1609 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1610 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1611 MAV_CMD_STORAGE_FORMAT = 526,
1612 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1613 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1614 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1615 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1616 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1617 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1618 #[doc = "Reset all camera settings to Factory Default"]
1619 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1620 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1621 MAV_CMD_SET_CAMERA_MODE = 530,
1622 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1623 MAV_CMD_SET_CAMERA_ZOOM = 531,
1624 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1625 MAV_CMD_SET_CAMERA_FOCUS = 532,
1626 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1627 MAV_CMD_SET_STORAGE_USAGE = 533,
1628 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1629 MAV_CMD_SET_CAMERA_SOURCE = 534,
1630 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1631 MAV_CMD_JUMP_TAG = 600,
1632 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1633 MAV_CMD_DO_JUMP_TAG = 601,
1634 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1635 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1636 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1637 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1638 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1639 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1640 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1641 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1642 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1643 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1644 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1645 #[doc = "Enable or disable on-board camera triggering system."]
1646 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1647 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1648 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1649 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1650 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1651 #[doc = "Stops ongoing tracking."]
1652 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1653 #[doc = "Starts video capture (recording)."]
1654 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1655 #[doc = "Stop the current video capture (recording)."]
1656 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1657 #[doc = "Start video streaming"]
1658 MAV_CMD_VIDEO_START_STREAMING = 2502,
1659 #[doc = "Stop the given video stream"]
1660 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1661 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1662 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1663 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1664 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1665 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1666 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1667 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1668 MAV_CMD_LOGGING_START = 2510,
1669 #[doc = "Request to stop streaming log data over MAVLink"]
1670 MAV_CMD_LOGGING_STOP = 2511,
1671 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1672 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1673 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1674 #[doc = "Create a panorama at the current position"]
1675 MAV_CMD_PANORAMA_CREATE = 2800,
1676 #[doc = "Request VTOL transition"]
1677 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1678 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1679 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1680 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1681 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1682 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1683 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1684 #[doc = "Delay mission state machine until gate has been reached."]
1685 MAV_CMD_CONDITION_GATE = 4501,
1686 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1687 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1688 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1689 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1690 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1691 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1692 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1693 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1694 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1695 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1696 #[doc = "Rally point. You can have multiple rally points defined."]
1697 MAV_CMD_NAV_RALLY_POINT = 5100,
1698 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1699 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1700 #[doc = "Change state of safety switch."]
1701 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1702 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1703 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1704 #[deprecated = " (Deprecated since 2021-06)"]
1705 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1706 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1707 #[deprecated = " (Deprecated since 2021-06)"]
1708 #[doc = "Control the payload deployment."]
1709 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1710 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1711 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1712 #[doc = "Command to operate winch."]
1713 MAV_CMD_DO_WINCH = 42600,
1714 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1715 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1716 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1717 MAV_CMD_WAYPOINT_USER_1 = 31000,
1718 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1719 MAV_CMD_WAYPOINT_USER_2 = 31001,
1720 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1721 MAV_CMD_WAYPOINT_USER_3 = 31002,
1722 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1723 MAV_CMD_WAYPOINT_USER_4 = 31003,
1724 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1725 MAV_CMD_WAYPOINT_USER_5 = 31004,
1726 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1727 MAV_CMD_SPATIAL_USER_1 = 31005,
1728 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1729 MAV_CMD_SPATIAL_USER_2 = 31006,
1730 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1731 MAV_CMD_SPATIAL_USER_3 = 31007,
1732 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1733 MAV_CMD_SPATIAL_USER_4 = 31008,
1734 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1735 MAV_CMD_SPATIAL_USER_5 = 31009,
1736 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1737 MAV_CMD_USER_1 = 31010,
1738 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1739 MAV_CMD_USER_2 = 31011,
1740 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1741 MAV_CMD_USER_3 = 31012,
1742 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1743 MAV_CMD_USER_4 = 31013,
1744 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1745 MAV_CMD_USER_5 = 31014,
1746 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1747 MAV_CMD_CAN_FORWARD = 32000,
1748}
1749impl MavCmd {
1750 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1751}
1752impl Default for MavCmd {
1753 fn default() -> Self {
1754 Self::DEFAULT
1755 }
1756}
1757#[cfg_attr(feature = "ts", derive(TS))]
1758#[cfg_attr(feature = "ts", ts(export))]
1759#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1760#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1761#[cfg_attr(feature = "serde", serde(tag = "type"))]
1762#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1763#[repr(u32)]
1764#[doc = "Possible actions an aircraft can take to avoid a collision."]
1765pub enum MavCollisionAction {
1766 #[doc = "Ignore any potential collisions"]
1767 MAV_COLLISION_ACTION_NONE = 0,
1768 #[doc = "Report potential collision"]
1769 MAV_COLLISION_ACTION_REPORT = 1,
1770 #[doc = "Ascend or Descend to avoid threat"]
1771 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1772 #[doc = "Move horizontally to avoid threat"]
1773 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1774 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1775 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1776 #[doc = "Aircraft to fly directly back to its launch point"]
1777 MAV_COLLISION_ACTION_RTL = 5,
1778 #[doc = "Aircraft to stop in place"]
1779 MAV_COLLISION_ACTION_HOVER = 6,
1780}
1781impl MavCollisionAction {
1782 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1783}
1784impl Default for MavCollisionAction {
1785 fn default() -> Self {
1786 Self::DEFAULT
1787 }
1788}
1789#[cfg_attr(feature = "ts", derive(TS))]
1790#[cfg_attr(feature = "ts", ts(export))]
1791#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1792#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1793#[cfg_attr(feature = "serde", serde(tag = "type"))]
1794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1795#[repr(u32)]
1796#[doc = "Source of information about this collision."]
1797pub enum MavCollisionSrc {
1798 #[doc = "ID field references ADSB_VEHICLE packets"]
1799 MAV_COLLISION_SRC_ADSB = 0,
1800 #[doc = "ID field references MAVLink SRC ID"]
1801 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1802}
1803impl MavCollisionSrc {
1804 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1805}
1806impl Default for MavCollisionSrc {
1807 fn default() -> Self {
1808 Self::DEFAULT
1809 }
1810}
1811#[cfg_attr(feature = "ts", derive(TS))]
1812#[cfg_attr(feature = "ts", ts(export))]
1813#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1815#[cfg_attr(feature = "serde", serde(tag = "type"))]
1816#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1817#[repr(u32)]
1818#[doc = "Aircraft-rated danger from this threat."]
1819pub enum MavCollisionThreatLevel {
1820 #[doc = "Not a threat"]
1821 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1822 #[doc = "Craft is mildly concerned about this threat"]
1823 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1824 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1825 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1826}
1827impl MavCollisionThreatLevel {
1828 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1829}
1830impl Default for MavCollisionThreatLevel {
1831 fn default() -> Self {
1832 Self::DEFAULT
1833 }
1834}
1835#[cfg_attr(feature = "ts", derive(TS))]
1836#[cfg_attr(feature = "ts", ts(export))]
1837#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1838#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1839#[cfg_attr(feature = "serde", serde(tag = "type"))]
1840#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1841#[repr(u32)]
1842#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1843pub enum MavComponent {
1844 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1845 MAV_COMP_ID_ALL = 0,
1846 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1847 MAV_COMP_ID_AUTOPILOT1 = 1,
1848 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1849 MAV_COMP_ID_USER1 = 25,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER2 = 26,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER3 = 27,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER4 = 28,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER5 = 29,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER6 = 30,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER7 = 31,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER8 = 32,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER9 = 33,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER10 = 34,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER11 = 35,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER12 = 36,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER13 = 37,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER14 = 38,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER15 = 39,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER16 = 40,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER17 = 41,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER18 = 42,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER19 = 43,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER20 = 44,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER21 = 45,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER22 = 46,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER23 = 47,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER24 = 48,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER25 = 49,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER26 = 50,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER27 = 51,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER28 = 52,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER29 = 53,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER30 = 54,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER31 = 55,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER32 = 56,
1912 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1913 MAV_COMP_ID_USER33 = 57,
1914 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1915 MAV_COMP_ID_USER34 = 58,
1916 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1917 MAV_COMP_ID_USER35 = 59,
1918 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1919 MAV_COMP_ID_USER36 = 60,
1920 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1921 MAV_COMP_ID_USER37 = 61,
1922 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1923 MAV_COMP_ID_USER38 = 62,
1924 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1925 MAV_COMP_ID_USER39 = 63,
1926 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1927 MAV_COMP_ID_USER40 = 64,
1928 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1929 MAV_COMP_ID_USER41 = 65,
1930 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1931 MAV_COMP_ID_USER42 = 66,
1932 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1933 MAV_COMP_ID_USER43 = 67,
1934 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1935 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1936 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1937 MAV_COMP_ID_USER45 = 69,
1938 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1939 MAV_COMP_ID_USER46 = 70,
1940 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1941 MAV_COMP_ID_USER47 = 71,
1942 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1943 MAV_COMP_ID_USER48 = 72,
1944 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1945 MAV_COMP_ID_USER49 = 73,
1946 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1947 MAV_COMP_ID_USER50 = 74,
1948 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1949 MAV_COMP_ID_USER51 = 75,
1950 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1951 MAV_COMP_ID_USER52 = 76,
1952 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1953 MAV_COMP_ID_USER53 = 77,
1954 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1955 MAV_COMP_ID_USER54 = 78,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER55 = 79,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER56 = 80,
1960 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1961 MAV_COMP_ID_USER57 = 81,
1962 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1963 MAV_COMP_ID_USER58 = 82,
1964 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1965 MAV_COMP_ID_USER59 = 83,
1966 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1967 MAV_COMP_ID_USER60 = 84,
1968 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1969 MAV_COMP_ID_USER61 = 85,
1970 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1971 MAV_COMP_ID_USER62 = 86,
1972 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1973 MAV_COMP_ID_USER63 = 87,
1974 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1975 MAV_COMP_ID_USER64 = 88,
1976 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1977 MAV_COMP_ID_USER65 = 89,
1978 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1979 MAV_COMP_ID_USER66 = 90,
1980 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1981 MAV_COMP_ID_USER67 = 91,
1982 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1983 MAV_COMP_ID_USER68 = 92,
1984 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1985 MAV_COMP_ID_USER69 = 93,
1986 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1987 MAV_COMP_ID_USER70 = 94,
1988 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1989 MAV_COMP_ID_USER71 = 95,
1990 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1991 MAV_COMP_ID_USER72 = 96,
1992 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1993 MAV_COMP_ID_USER73 = 97,
1994 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1995 MAV_COMP_ID_USER74 = 98,
1996 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1997 MAV_COMP_ID_USER75 = 99,
1998 #[doc = "Camera #1."]
1999 MAV_COMP_ID_CAMERA = 100,
2000 #[doc = "Camera #2."]
2001 MAV_COMP_ID_CAMERA2 = 101,
2002 #[doc = "Camera #3."]
2003 MAV_COMP_ID_CAMERA3 = 102,
2004 #[doc = "Camera #4."]
2005 MAV_COMP_ID_CAMERA4 = 103,
2006 #[doc = "Camera #5."]
2007 MAV_COMP_ID_CAMERA5 = 104,
2008 #[doc = "Camera #6."]
2009 MAV_COMP_ID_CAMERA6 = 105,
2010 #[doc = "Servo #1."]
2011 MAV_COMP_ID_SERVO1 = 140,
2012 #[doc = "Servo #2."]
2013 MAV_COMP_ID_SERVO2 = 141,
2014 #[doc = "Servo #3."]
2015 MAV_COMP_ID_SERVO3 = 142,
2016 #[doc = "Servo #4."]
2017 MAV_COMP_ID_SERVO4 = 143,
2018 #[doc = "Servo #5."]
2019 MAV_COMP_ID_SERVO5 = 144,
2020 #[doc = "Servo #6."]
2021 MAV_COMP_ID_SERVO6 = 145,
2022 #[doc = "Servo #7."]
2023 MAV_COMP_ID_SERVO7 = 146,
2024 #[doc = "Servo #8."]
2025 MAV_COMP_ID_SERVO8 = 147,
2026 #[doc = "Servo #9."]
2027 MAV_COMP_ID_SERVO9 = 148,
2028 #[doc = "Servo #10."]
2029 MAV_COMP_ID_SERVO10 = 149,
2030 #[doc = "Servo #11."]
2031 MAV_COMP_ID_SERVO11 = 150,
2032 #[doc = "Servo #12."]
2033 MAV_COMP_ID_SERVO12 = 151,
2034 #[doc = "Servo #13."]
2035 MAV_COMP_ID_SERVO13 = 152,
2036 #[doc = "Servo #14."]
2037 MAV_COMP_ID_SERVO14 = 153,
2038 #[doc = "Gimbal #1."]
2039 MAV_COMP_ID_GIMBAL = 154,
2040 #[doc = "Logging component."]
2041 MAV_COMP_ID_LOG = 155,
2042 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2043 MAV_COMP_ID_ADSB = 156,
2044 #[doc = "On Screen Display (OSD) devices for video links."]
2045 MAV_COMP_ID_OSD = 157,
2046 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2047 MAV_COMP_ID_PERIPHERAL = 158,
2048 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2049 #[doc = "Gimbal ID for QX1."]
2050 MAV_COMP_ID_QX1_GIMBAL = 159,
2051 #[doc = "FLARM collision alert component."]
2052 MAV_COMP_ID_FLARM = 160,
2053 #[doc = "Parachute component."]
2054 MAV_COMP_ID_PARACHUTE = 161,
2055 #[doc = "Winch component."]
2056 MAV_COMP_ID_WINCH = 169,
2057 #[doc = "Gimbal #2."]
2058 MAV_COMP_ID_GIMBAL2 = 171,
2059 #[doc = "Gimbal #3."]
2060 MAV_COMP_ID_GIMBAL3 = 172,
2061 #[doc = "Gimbal #4"]
2062 MAV_COMP_ID_GIMBAL4 = 173,
2063 #[doc = "Gimbal #5."]
2064 MAV_COMP_ID_GIMBAL5 = 174,
2065 #[doc = "Gimbal #6."]
2066 MAV_COMP_ID_GIMBAL6 = 175,
2067 #[doc = "Battery #1."]
2068 MAV_COMP_ID_BATTERY = 180,
2069 #[doc = "Battery #2."]
2070 MAV_COMP_ID_BATTERY2 = 181,
2071 #[doc = "CAN over MAVLink client."]
2072 MAV_COMP_ID_MAVCAN = 189,
2073 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2074 MAV_COMP_ID_MISSIONPLANNER = 190,
2075 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2076 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2077 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2078 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2079 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2080 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2081 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2082 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2083 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2084 MAV_COMP_ID_PATHPLANNER = 195,
2085 #[doc = "Component that plans a collision free path between two points."]
2086 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2087 #[doc = "Component that provides position estimates using VIO techniques."]
2088 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2089 #[doc = "Component that manages pairing of vehicle and GCS."]
2090 MAV_COMP_ID_PAIRING_MANAGER = 198,
2091 #[doc = "Inertial Measurement Unit (IMU) #1."]
2092 MAV_COMP_ID_IMU = 200,
2093 #[doc = "Inertial Measurement Unit (IMU) #2."]
2094 MAV_COMP_ID_IMU_2 = 201,
2095 #[doc = "Inertial Measurement Unit (IMU) #3."]
2096 MAV_COMP_ID_IMU_3 = 202,
2097 #[doc = "GPS #1."]
2098 MAV_COMP_ID_GPS = 220,
2099 #[doc = "GPS #2."]
2100 MAV_COMP_ID_GPS2 = 221,
2101 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2102 MAV_COMP_ID_ODID_TXRX_1 = 236,
2103 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2104 MAV_COMP_ID_ODID_TXRX_2 = 237,
2105 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2106 MAV_COMP_ID_ODID_TXRX_3 = 238,
2107 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2108 MAV_COMP_ID_UDP_BRIDGE = 240,
2109 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2110 MAV_COMP_ID_UART_BRIDGE = 241,
2111 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2112 MAV_COMP_ID_TUNNEL_NODE = 242,
2113 #[doc = "Illuminator"]
2114 MAV_COMP_ID_ILLUMINATOR = 243,
2115 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2116 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2117 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2118}
2119impl MavComponent {
2120 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2121}
2122impl Default for MavComponent {
2123 fn default() -> Self {
2124 Self::DEFAULT
2125 }
2126}
2127#[cfg_attr(feature = "ts", derive(TS))]
2128#[cfg_attr(feature = "ts", ts(export))]
2129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2131#[cfg_attr(feature = "serde", serde(tag = "type"))]
2132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2133#[repr(u32)]
2134#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2135#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2136pub enum MavDataStream {
2137 #[doc = "Enable all data streams"]
2138 MAV_DATA_STREAM_ALL = 0,
2139 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2140 MAV_DATA_STREAM_RAW_SENSORS = 1,
2141 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2142 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2143 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2144 MAV_DATA_STREAM_RC_CHANNELS = 3,
2145 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2146 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2147 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2148 MAV_DATA_STREAM_POSITION = 6,
2149 #[doc = "Dependent on the autopilot"]
2150 MAV_DATA_STREAM_EXTRA1 = 10,
2151 #[doc = "Dependent on the autopilot"]
2152 MAV_DATA_STREAM_EXTRA2 = 11,
2153 #[doc = "Dependent on the autopilot"]
2154 MAV_DATA_STREAM_EXTRA3 = 12,
2155}
2156impl MavDataStream {
2157 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2158}
2159impl Default for MavDataStream {
2160 fn default() -> Self {
2161 Self::DEFAULT
2162 }
2163}
2164#[cfg_attr(feature = "ts", derive(TS))]
2165#[cfg_attr(feature = "ts", ts(export))]
2166#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2168#[cfg_attr(feature = "serde", serde(tag = "type"))]
2169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2170#[repr(u32)]
2171#[doc = "Enumeration of distance sensor types"]
2172pub enum MavDistanceSensor {
2173 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2174 MAV_DISTANCE_SENSOR_LASER = 0,
2175 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2176 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2177 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2178 MAV_DISTANCE_SENSOR_INFRARED = 2,
2179 #[doc = "Radar type, e.g. uLanding units"]
2180 MAV_DISTANCE_SENSOR_RADAR = 3,
2181 #[doc = "Broken or unknown type, e.g. analog units"]
2182 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2183}
2184impl MavDistanceSensor {
2185 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2186}
2187impl Default for MavDistanceSensor {
2188 fn default() -> Self {
2189 Self::DEFAULT
2190 }
2191}
2192#[cfg_attr(feature = "ts", derive(TS))]
2193#[cfg_attr(feature = "ts", ts(export))]
2194#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2195#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2196#[cfg_attr(feature = "serde", serde(tag = "type"))]
2197#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2198#[repr(u32)]
2199#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2200pub enum MavDoRepositionFlags {
2201 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2202 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2203}
2204impl MavDoRepositionFlags {
2205 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2206}
2207impl Default for MavDoRepositionFlags {
2208 fn default() -> Self {
2209 Self::DEFAULT
2210 }
2211}
2212#[cfg_attr(feature = "ts", derive(TS))]
2213#[cfg_attr(feature = "ts", ts(export))]
2214#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2216#[cfg_attr(feature = "serde", serde(tag = "type"))]
2217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2218#[repr(u32)]
2219#[doc = "Enumeration of estimator types"]
2220pub enum MavEstimatorType {
2221 #[doc = "Unknown type of the estimator."]
2222 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2223 #[doc = "This is a naive estimator without any real covariance feedback."]
2224 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2225 #[doc = "Computer vision based estimate. Might be up to scale."]
2226 MAV_ESTIMATOR_TYPE_VISION = 2,
2227 #[doc = "Visual-inertial estimate."]
2228 MAV_ESTIMATOR_TYPE_VIO = 3,
2229 #[doc = "Plain GPS estimate."]
2230 MAV_ESTIMATOR_TYPE_GPS = 4,
2231 #[doc = "Estimator integrating GPS and inertial sensing."]
2232 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2233 #[doc = "Estimate from external motion capturing system."]
2234 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2235 #[doc = "Estimator based on lidar sensor input."]
2236 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2237 #[doc = "Estimator on autopilot."]
2238 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2239}
2240impl MavEstimatorType {
2241 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2242}
2243impl Default for MavEstimatorType {
2244 fn default() -> Self {
2245 Self::DEFAULT
2246 }
2247}
2248#[cfg_attr(feature = "ts", derive(TS))]
2249#[cfg_attr(feature = "ts", ts(export))]
2250#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2251#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2252#[cfg_attr(feature = "serde", serde(tag = "type"))]
2253#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2254#[repr(u32)]
2255#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2256pub enum MavEventCurrentSequenceFlags {
2257 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2258 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2259}
2260impl MavEventCurrentSequenceFlags {
2261 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2262}
2263impl Default for MavEventCurrentSequenceFlags {
2264 fn default() -> Self {
2265 Self::DEFAULT
2266 }
2267}
2268#[cfg_attr(feature = "ts", derive(TS))]
2269#[cfg_attr(feature = "ts", ts(export))]
2270#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2272#[cfg_attr(feature = "serde", serde(tag = "type"))]
2273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2274#[repr(u32)]
2275#[doc = "Reason for an event error response."]
2276pub enum MavEventErrorReason {
2277 #[doc = "The requested event is not available (anymore)."]
2278 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2279}
2280impl MavEventErrorReason {
2281 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2282}
2283impl Default for MavEventErrorReason {
2284 fn default() -> Self {
2285 Self::DEFAULT
2286 }
2287}
2288#[cfg_attr(feature = "ts", derive(TS))]
2289#[cfg_attr(feature = "ts", ts(export))]
2290#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2291#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2292#[cfg_attr(feature = "serde", serde(tag = "type"))]
2293#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2294#[repr(u32)]
2295#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2296pub enum MavFrame {
2297 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2298 MAV_FRAME_GLOBAL = 0,
2299 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2300 MAV_FRAME_LOCAL_NED = 1,
2301 #[doc = "NOT a coordinate frame, indicates a mission command."]
2302 MAV_FRAME_MISSION = 2,
2303 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2304 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2305 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2306 MAV_FRAME_LOCAL_ENU = 4,
2307 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2308 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2309 MAV_FRAME_GLOBAL_INT = 5,
2310 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2311 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2312 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2313 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2314 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2315 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2316 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2317 MAV_FRAME_BODY_NED = 8,
2318 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2319 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2320 MAV_FRAME_BODY_OFFSET_NED = 9,
2321 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2322 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2323 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2324 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2325 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2326 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2327 MAV_FRAME_BODY_FRD = 12,
2328 #[deprecated = " (Deprecated since 2019-04)"]
2329 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2330 MAV_FRAME_RESERVED_13 = 13,
2331 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2332 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2333 MAV_FRAME_RESERVED_14 = 14,
2334 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2335 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2336 MAV_FRAME_RESERVED_15 = 15,
2337 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2338 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2339 MAV_FRAME_RESERVED_16 = 16,
2340 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2341 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2342 MAV_FRAME_RESERVED_17 = 17,
2343 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2344 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2345 MAV_FRAME_RESERVED_18 = 18,
2346 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2347 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2348 MAV_FRAME_RESERVED_19 = 19,
2349 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2350 MAV_FRAME_LOCAL_FRD = 20,
2351 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2352 MAV_FRAME_LOCAL_FLU = 21,
2353}
2354impl MavFrame {
2355 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2356}
2357impl Default for MavFrame {
2358 fn default() -> Self {
2359 Self::DEFAULT
2360 }
2361}
2362#[cfg_attr(feature = "ts", derive(TS))]
2363#[cfg_attr(feature = "ts", ts(export))]
2364#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2366#[cfg_attr(feature = "serde", serde(tag = "type"))]
2367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2368#[repr(u32)]
2369#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2370pub enum MavFtpErr {
2371 #[doc = "None: No error"]
2372 MAV_FTP_ERR_NONE = 0,
2373 #[doc = "Fail: Unknown failure"]
2374 MAV_FTP_ERR_FAIL = 1,
2375 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2376 MAV_FTP_ERR_FAILERRNO = 2,
2377 #[doc = "InvalidDataSize: Payload size is invalid"]
2378 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2379 #[doc = "InvalidSession: Session is not currently open"]
2380 MAV_FTP_ERR_INVALIDSESSION = 4,
2381 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2382 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2383 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2384 MAV_FTP_ERR_EOF = 6,
2385 #[doc = "UnknownCommand: Unknown command / opcode"]
2386 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2387 #[doc = "FileExists: File/directory already exists"]
2388 MAV_FTP_ERR_FILEEXISTS = 8,
2389 #[doc = "FileProtected: File/directory is write protected"]
2390 MAV_FTP_ERR_FILEPROTECTED = 9,
2391 #[doc = "FileNotFound: File/directory not found"]
2392 MAV_FTP_ERR_FILENOTFOUND = 10,
2393}
2394impl MavFtpErr {
2395 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2396}
2397impl Default for MavFtpErr {
2398 fn default() -> Self {
2399 Self::DEFAULT
2400 }
2401}
2402#[cfg_attr(feature = "ts", derive(TS))]
2403#[cfg_attr(feature = "ts", ts(export))]
2404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2406#[cfg_attr(feature = "serde", serde(tag = "type"))]
2407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2408#[repr(u32)]
2409#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2410pub enum MavFtpOpcode {
2411 #[doc = "None. Ignored, always ACKed"]
2412 MAV_FTP_OPCODE_NONE = 0,
2413 #[doc = "TerminateSession: Terminates open Read session"]
2414 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2415 #[doc = "ResetSessions: Terminates all open read sessions"]
2416 MAV_FTP_OPCODE_RESETSESSION = 2,
2417 #[doc = "ListDirectory. List files and directories in path from offset"]
2418 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2419 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2420 MAV_FTP_OPCODE_OPENFILERO = 4,
2421 #[doc = "ReadFile: Reads size bytes from offset in session"]
2422 MAV_FTP_OPCODE_READFILE = 5,
2423 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2424 MAV_FTP_OPCODE_CREATEFILE = 6,
2425 #[doc = "WriteFile: Writes size bytes to offset in session"]
2426 MAV_FTP_OPCODE_WRITEFILE = 7,
2427 #[doc = "RemoveFile: Remove file at path"]
2428 MAV_FTP_OPCODE_REMOVEFILE = 8,
2429 #[doc = "CreateDirectory: Creates directory at path"]
2430 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2431 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2432 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2433 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2434 MAV_FTP_OPCODE_OPENFILEWO = 11,
2435 #[doc = "TruncateFile: Truncate file at path to offset length"]
2436 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2437 #[doc = "Rename: Rename path1 to path2"]
2438 MAV_FTP_OPCODE_RENAME = 13,
2439 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2440 MAV_FTP_OPCODE_CALCFILECRC = 14,
2441 #[doc = "BurstReadFile: Burst download session file"]
2442 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2443 #[doc = "ACK: ACK response"]
2444 MAV_FTP_OPCODE_ACK = 128,
2445 #[doc = "NAK: NAK response"]
2446 MAV_FTP_OPCODE_NAK = 129,
2447}
2448impl MavFtpOpcode {
2449 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2450}
2451impl Default for MavFtpOpcode {
2452 fn default() -> Self {
2453 Self::DEFAULT
2454 }
2455}
2456#[cfg_attr(feature = "ts", derive(TS))]
2457#[cfg_attr(feature = "ts", ts(export))]
2458#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2459#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2460#[cfg_attr(feature = "serde", serde(tag = "type"))]
2461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2462#[repr(u32)]
2463#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2464pub enum MavFuelType {
2465 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2466 MAV_FUEL_TYPE_UNKNOWN = 0,
2467 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2468 MAV_FUEL_TYPE_LIQUID = 1,
2469 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2470 MAV_FUEL_TYPE_GAS = 2,
2471}
2472impl MavFuelType {
2473 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2474}
2475impl Default for MavFuelType {
2476 fn default() -> Self {
2477 Self::DEFAULT
2478 }
2479}
2480bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2481impl MavGeneratorStatusFlag {
2482 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2483}
2484impl Default for MavGeneratorStatusFlag {
2485 fn default() -> Self {
2486 Self::DEFAULT
2487 }
2488}
2489#[cfg_attr(feature = "ts", derive(TS))]
2490#[cfg_attr(feature = "ts", ts(export))]
2491#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2492#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2493#[cfg_attr(feature = "serde", serde(tag = "type"))]
2494#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2495#[repr(u32)]
2496#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2497pub enum MavGoto {
2498 #[doc = "Hold at the current position."]
2499 MAV_GOTO_DO_HOLD = 0,
2500 #[doc = "Continue with the next item in mission execution."]
2501 MAV_GOTO_DO_CONTINUE = 1,
2502 #[doc = "Hold at the current position of the system"]
2503 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2504 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2505 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2506}
2507impl MavGoto {
2508 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2509}
2510impl Default for MavGoto {
2511 fn default() -> Self {
2512 Self::DEFAULT
2513 }
2514}
2515#[cfg_attr(feature = "ts", derive(TS))]
2516#[cfg_attr(feature = "ts", ts(export))]
2517#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2519#[cfg_attr(feature = "serde", serde(tag = "type"))]
2520#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2521#[repr(u32)]
2522#[doc = "Enumeration of landed detector states"]
2523pub enum MavLandedState {
2524 #[doc = "MAV landed state is unknown"]
2525 MAV_LANDED_STATE_UNDEFINED = 0,
2526 #[doc = "MAV is landed (on ground)"]
2527 MAV_LANDED_STATE_ON_GROUND = 1,
2528 #[doc = "MAV is in air"]
2529 MAV_LANDED_STATE_IN_AIR = 2,
2530 #[doc = "MAV currently taking off"]
2531 MAV_LANDED_STATE_TAKEOFF = 3,
2532 #[doc = "MAV currently landing"]
2533 MAV_LANDED_STATE_LANDING = 4,
2534}
2535impl MavLandedState {
2536 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2537}
2538impl Default for MavLandedState {
2539 fn default() -> Self {
2540 Self::DEFAULT
2541 }
2542}
2543#[cfg_attr(feature = "ts", derive(TS))]
2544#[cfg_attr(feature = "ts", ts(export))]
2545#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2547#[cfg_attr(feature = "serde", serde(tag = "type"))]
2548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2549#[repr(u32)]
2550#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2551pub enum MavMissionResult {
2552 #[doc = "mission accepted OK"]
2553 MAV_MISSION_ACCEPTED = 0,
2554 #[doc = "Generic error / not accepting mission commands at all right now."]
2555 MAV_MISSION_ERROR = 1,
2556 #[doc = "Coordinate frame is not supported."]
2557 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2558 #[doc = "Command is not supported."]
2559 MAV_MISSION_UNSUPPORTED = 3,
2560 #[doc = "Mission items exceed storage space."]
2561 MAV_MISSION_NO_SPACE = 4,
2562 #[doc = "One of the parameters has an invalid value."]
2563 MAV_MISSION_INVALID = 5,
2564 #[doc = "param1 has an invalid value."]
2565 MAV_MISSION_INVALID_PARAM1 = 6,
2566 #[doc = "param2 has an invalid value."]
2567 MAV_MISSION_INVALID_PARAM2 = 7,
2568 #[doc = "param3 has an invalid value."]
2569 MAV_MISSION_INVALID_PARAM3 = 8,
2570 #[doc = "param4 has an invalid value."]
2571 MAV_MISSION_INVALID_PARAM4 = 9,
2572 #[doc = "x / param5 has an invalid value."]
2573 MAV_MISSION_INVALID_PARAM5_X = 10,
2574 #[doc = "y / param6 has an invalid value."]
2575 MAV_MISSION_INVALID_PARAM6_Y = 11,
2576 #[doc = "z / param7 has an invalid value."]
2577 MAV_MISSION_INVALID_PARAM7 = 12,
2578 #[doc = "Mission item received out of sequence"]
2579 MAV_MISSION_INVALID_SEQUENCE = 13,
2580 #[doc = "Not accepting any mission commands from this communication partner."]
2581 MAV_MISSION_DENIED = 14,
2582 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2583 MAV_MISSION_OPERATION_CANCELLED = 15,
2584}
2585impl MavMissionResult {
2586 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2587}
2588impl Default for MavMissionResult {
2589 fn default() -> Self {
2590 Self::DEFAULT
2591 }
2592}
2593#[cfg_attr(feature = "ts", derive(TS))]
2594#[cfg_attr(feature = "ts", ts(export))]
2595#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2597#[cfg_attr(feature = "serde", serde(tag = "type"))]
2598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2599#[repr(u32)]
2600#[doc = "Type of mission items being requested/sent in mission protocol."]
2601pub enum MavMissionType {
2602 #[doc = "Items are mission commands for main mission."]
2603 MAV_MISSION_TYPE_MISSION = 0,
2604 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2605 MAV_MISSION_TYPE_FENCE = 1,
2606 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2607 MAV_MISSION_TYPE_RALLY = 2,
2608 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2609 MAV_MISSION_TYPE_ALL = 255,
2610}
2611impl MavMissionType {
2612 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2613}
2614impl Default for MavMissionType {
2615 fn default() -> Self {
2616 Self::DEFAULT
2617 }
2618}
2619#[cfg_attr(feature = "ts", derive(TS))]
2620#[cfg_attr(feature = "ts", ts(export))]
2621#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2623#[cfg_attr(feature = "serde", serde(tag = "type"))]
2624#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2625#[repr(u32)]
2626#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2627pub enum MavMode {
2628 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2629 MAV_MODE_PREFLIGHT = 0,
2630 #[doc = "System is allowed to be active, under assisted RC control."]
2631 MAV_MODE_STABILIZE_DISARMED = 80,
2632 #[doc = "System is allowed to be active, under assisted RC control."]
2633 MAV_MODE_STABILIZE_ARMED = 208,
2634 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2635 MAV_MODE_MANUAL_DISARMED = 64,
2636 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2637 MAV_MODE_MANUAL_ARMED = 192,
2638 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2639 MAV_MODE_GUIDED_DISARMED = 88,
2640 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2641 MAV_MODE_GUIDED_ARMED = 216,
2642 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2643 MAV_MODE_AUTO_DISARMED = 92,
2644 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2645 MAV_MODE_AUTO_ARMED = 220,
2646 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2647 MAV_MODE_TEST_DISARMED = 66,
2648 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2649 MAV_MODE_TEST_ARMED = 194,
2650}
2651impl MavMode {
2652 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2653}
2654impl Default for MavMode {
2655 fn default() -> Self {
2656 Self::DEFAULT
2657 }
2658}
2659bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2660impl MavModeFlag {
2661 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2662}
2663impl Default for MavModeFlag {
2664 fn default() -> Self {
2665 Self::DEFAULT
2666 }
2667}
2668#[cfg_attr(feature = "ts", derive(TS))]
2669#[cfg_attr(feature = "ts", ts(export))]
2670#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2672#[cfg_attr(feature = "serde", serde(tag = "type"))]
2673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2674#[repr(u32)]
2675#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2676pub enum MavModeFlagDecodePosition {
2677 #[doc = "First bit: 10000000"]
2678 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2679 #[doc = "Second bit: 01000000"]
2680 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2681 #[doc = "Third bit: 00100000"]
2682 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2683 #[doc = "Fourth bit: 00010000"]
2684 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2685 #[doc = "Fifth bit: 00001000"]
2686 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2687 #[doc = "Sixth bit: 00000100"]
2688 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2689 #[doc = "Seventh bit: 00000010"]
2690 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2691 #[doc = "Eighth bit: 00000001"]
2692 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2693}
2694impl MavModeFlagDecodePosition {
2695 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2696}
2697impl Default for MavModeFlagDecodePosition {
2698 fn default() -> Self {
2699 Self::DEFAULT
2700 }
2701}
2702bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2703impl MavModeProperty {
2704 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2705}
2706impl Default for MavModeProperty {
2707 fn default() -> Self {
2708 Self::DEFAULT
2709 }
2710}
2711#[cfg_attr(feature = "ts", derive(TS))]
2712#[cfg_attr(feature = "ts", ts(export))]
2713#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2714#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2715#[cfg_attr(feature = "serde", serde(tag = "type"))]
2716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2717#[repr(u32)]
2718#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2719#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2720pub enum MavMountMode {
2721 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2722 MAV_MOUNT_MODE_RETRACT = 0,
2723 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2724 MAV_MOUNT_MODE_NEUTRAL = 1,
2725 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2726 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2727 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2728 MAV_MOUNT_MODE_RC_TARGETING = 3,
2729 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2730 MAV_MOUNT_MODE_GPS_POINT = 4,
2731 #[doc = "Gimbal tracks system with specified system ID"]
2732 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2733 #[doc = "Gimbal tracks home position"]
2734 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2735}
2736impl MavMountMode {
2737 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2738}
2739impl Default for MavMountMode {
2740 fn default() -> Self {
2741 Self::DEFAULT
2742 }
2743}
2744#[cfg_attr(feature = "ts", derive(TS))]
2745#[cfg_attr(feature = "ts", ts(export))]
2746#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2748#[cfg_attr(feature = "serde", serde(tag = "type"))]
2749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2750#[repr(u32)]
2751pub enum MavOdidArmStatus {
2752 #[doc = "Passing arming checks."]
2753 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2754 #[doc = "Generic arming failure, see error string for details."]
2755 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2756}
2757impl MavOdidArmStatus {
2758 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2759}
2760impl Default for MavOdidArmStatus {
2761 fn default() -> Self {
2762 Self::DEFAULT
2763 }
2764}
2765#[cfg_attr(feature = "ts", derive(TS))]
2766#[cfg_attr(feature = "ts", ts(export))]
2767#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2768#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2769#[cfg_attr(feature = "serde", serde(tag = "type"))]
2770#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2771#[repr(u32)]
2772pub enum MavOdidAuthType {
2773 #[doc = "No authentication type is specified."]
2774 MAV_ODID_AUTH_TYPE_NONE = 0,
2775 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2776 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2777 #[doc = "Signature for the Operator ID."]
2778 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2779 #[doc = "Signature for the entire message set."]
2780 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2781 #[doc = "Authentication is provided by Network Remote ID."]
2782 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2783 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2784 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2785}
2786impl MavOdidAuthType {
2787 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2788}
2789impl Default for MavOdidAuthType {
2790 fn default() -> Self {
2791 Self::DEFAULT
2792 }
2793}
2794#[cfg_attr(feature = "ts", derive(TS))]
2795#[cfg_attr(feature = "ts", ts(export))]
2796#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2797#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2798#[cfg_attr(feature = "serde", serde(tag = "type"))]
2799#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2800#[repr(u32)]
2801pub enum MavOdidCategoryEu {
2802 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2803 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2804 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2805 MAV_ODID_CATEGORY_EU_OPEN = 1,
2806 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2807 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2808 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2809 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2810}
2811impl MavOdidCategoryEu {
2812 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2813}
2814impl Default for MavOdidCategoryEu {
2815 fn default() -> Self {
2816 Self::DEFAULT
2817 }
2818}
2819#[cfg_attr(feature = "ts", derive(TS))]
2820#[cfg_attr(feature = "ts", ts(export))]
2821#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2822#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2823#[cfg_attr(feature = "serde", serde(tag = "type"))]
2824#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2825#[repr(u32)]
2826pub enum MavOdidClassEu {
2827 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2828 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2829 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2830 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2831 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2832 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2833 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2834 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2835 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2836 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2837 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2838 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2839 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2840 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2841 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2842 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2843}
2844impl MavOdidClassEu {
2845 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2846}
2847impl Default for MavOdidClassEu {
2848 fn default() -> Self {
2849 Self::DEFAULT
2850 }
2851}
2852#[cfg_attr(feature = "ts", derive(TS))]
2853#[cfg_attr(feature = "ts", ts(export))]
2854#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2855#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2856#[cfg_attr(feature = "serde", serde(tag = "type"))]
2857#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2858#[repr(u32)]
2859pub enum MavOdidClassificationType {
2860 #[doc = "The classification type for the UA is undeclared."]
2861 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2862 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2863 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2864}
2865impl MavOdidClassificationType {
2866 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2867}
2868impl Default for MavOdidClassificationType {
2869 fn default() -> Self {
2870 Self::DEFAULT
2871 }
2872}
2873#[cfg_attr(feature = "ts", derive(TS))]
2874#[cfg_attr(feature = "ts", ts(export))]
2875#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2877#[cfg_attr(feature = "serde", serde(tag = "type"))]
2878#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2879#[repr(u32)]
2880pub enum MavOdidDescType {
2881 #[doc = "Optional free-form text description of the purpose of the flight."]
2882 MAV_ODID_DESC_TYPE_TEXT = 0,
2883 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2884 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2885 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2886 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2887}
2888impl MavOdidDescType {
2889 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2890}
2891impl Default for MavOdidDescType {
2892 fn default() -> Self {
2893 Self::DEFAULT
2894 }
2895}
2896#[cfg_attr(feature = "ts", derive(TS))]
2897#[cfg_attr(feature = "ts", ts(export))]
2898#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2900#[cfg_attr(feature = "serde", serde(tag = "type"))]
2901#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2902#[repr(u32)]
2903pub enum MavOdidHeightRef {
2904 #[doc = "The height field is relative to the take-off location."]
2905 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2906 #[doc = "The height field is relative to ground."]
2907 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2908}
2909impl MavOdidHeightRef {
2910 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2911}
2912impl Default for MavOdidHeightRef {
2913 fn default() -> Self {
2914 Self::DEFAULT
2915 }
2916}
2917#[cfg_attr(feature = "ts", derive(TS))]
2918#[cfg_attr(feature = "ts", ts(export))]
2919#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2921#[cfg_attr(feature = "serde", serde(tag = "type"))]
2922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2923#[repr(u32)]
2924pub enum MavOdidHorAcc {
2925 #[doc = "The horizontal accuracy is unknown."]
2926 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2927 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2928 MAV_ODID_HOR_ACC_10NM = 1,
2929 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2930 MAV_ODID_HOR_ACC_4NM = 2,
2931 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2932 MAV_ODID_HOR_ACC_2NM = 3,
2933 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2934 MAV_ODID_HOR_ACC_1NM = 4,
2935 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2936 MAV_ODID_HOR_ACC_0_5NM = 5,
2937 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2938 MAV_ODID_HOR_ACC_0_3NM = 6,
2939 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2940 MAV_ODID_HOR_ACC_0_1NM = 7,
2941 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2942 MAV_ODID_HOR_ACC_0_05NM = 8,
2943 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2944 MAV_ODID_HOR_ACC_30_METER = 9,
2945 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2946 MAV_ODID_HOR_ACC_10_METER = 10,
2947 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2948 MAV_ODID_HOR_ACC_3_METER = 11,
2949 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2950 MAV_ODID_HOR_ACC_1_METER = 12,
2951}
2952impl MavOdidHorAcc {
2953 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2954}
2955impl Default for MavOdidHorAcc {
2956 fn default() -> Self {
2957 Self::DEFAULT
2958 }
2959}
2960#[cfg_attr(feature = "ts", derive(TS))]
2961#[cfg_attr(feature = "ts", ts(export))]
2962#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2964#[cfg_attr(feature = "serde", serde(tag = "type"))]
2965#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2966#[repr(u32)]
2967pub enum MavOdidIdType {
2968 #[doc = "No type defined."]
2969 MAV_ODID_ID_TYPE_NONE = 0,
2970 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2971 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2972 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2973 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2974 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2975 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2976 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2977 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2978}
2979impl MavOdidIdType {
2980 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2981}
2982impl Default for MavOdidIdType {
2983 fn default() -> Self {
2984 Self::DEFAULT
2985 }
2986}
2987#[cfg_attr(feature = "ts", derive(TS))]
2988#[cfg_attr(feature = "ts", ts(export))]
2989#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2990#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2991#[cfg_attr(feature = "serde", serde(tag = "type"))]
2992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2993#[repr(u32)]
2994pub enum MavOdidOperatorIdType {
2995 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2996 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2997}
2998impl MavOdidOperatorIdType {
2999 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
3000}
3001impl Default for MavOdidOperatorIdType {
3002 fn default() -> Self {
3003 Self::DEFAULT
3004 }
3005}
3006#[cfg_attr(feature = "ts", derive(TS))]
3007#[cfg_attr(feature = "ts", ts(export))]
3008#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3009#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3010#[cfg_attr(feature = "serde", serde(tag = "type"))]
3011#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3012#[repr(u32)]
3013pub enum MavOdidOperatorLocationType {
3014 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3015 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3016 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3017 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3018 #[doc = "The location/altitude of the operator are fixed values."]
3019 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3020}
3021impl MavOdidOperatorLocationType {
3022 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3023}
3024impl Default for MavOdidOperatorLocationType {
3025 fn default() -> Self {
3026 Self::DEFAULT
3027 }
3028}
3029#[cfg_attr(feature = "ts", derive(TS))]
3030#[cfg_attr(feature = "ts", ts(export))]
3031#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3033#[cfg_attr(feature = "serde", serde(tag = "type"))]
3034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3035#[repr(u32)]
3036pub enum MavOdidSpeedAcc {
3037 #[doc = "The speed accuracy is unknown."]
3038 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3039 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3040 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3041 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3042 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3043 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3044 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3045 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3046 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3047}
3048impl MavOdidSpeedAcc {
3049 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3050}
3051impl Default for MavOdidSpeedAcc {
3052 fn default() -> Self {
3053 Self::DEFAULT
3054 }
3055}
3056#[cfg_attr(feature = "ts", derive(TS))]
3057#[cfg_attr(feature = "ts", ts(export))]
3058#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3060#[cfg_attr(feature = "serde", serde(tag = "type"))]
3061#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3062#[repr(u32)]
3063pub enum MavOdidStatus {
3064 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3065 MAV_ODID_STATUS_UNDECLARED = 0,
3066 #[doc = "The UA is on the ground."]
3067 MAV_ODID_STATUS_GROUND = 1,
3068 #[doc = "The UA is in the air."]
3069 MAV_ODID_STATUS_AIRBORNE = 2,
3070 #[doc = "The UA is having an emergency."]
3071 MAV_ODID_STATUS_EMERGENCY = 3,
3072 #[doc = "The remote ID system is failing or unreliable in some way."]
3073 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3074}
3075impl MavOdidStatus {
3076 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3077}
3078impl Default for MavOdidStatus {
3079 fn default() -> Self {
3080 Self::DEFAULT
3081 }
3082}
3083#[cfg_attr(feature = "ts", derive(TS))]
3084#[cfg_attr(feature = "ts", ts(export))]
3085#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3087#[cfg_attr(feature = "serde", serde(tag = "type"))]
3088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3089#[repr(u32)]
3090pub enum MavOdidTimeAcc {
3091 #[doc = "The timestamp accuracy is unknown."]
3092 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3093 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3094 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3095 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3096 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3097 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3098 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3099 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3100 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3101 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3102 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3103 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3104 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3105 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3106 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3107 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3108 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3109 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3110 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3111 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3112 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3113 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3114 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3115 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3116 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3117 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3118 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3119 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3120 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3121 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3122 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3123}
3124impl MavOdidTimeAcc {
3125 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3126}
3127impl Default for MavOdidTimeAcc {
3128 fn default() -> Self {
3129 Self::DEFAULT
3130 }
3131}
3132#[cfg_attr(feature = "ts", derive(TS))]
3133#[cfg_attr(feature = "ts", ts(export))]
3134#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3135#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3136#[cfg_attr(feature = "serde", serde(tag = "type"))]
3137#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3138#[repr(u32)]
3139pub enum MavOdidUaType {
3140 #[doc = "No UA (Unmanned Aircraft) type defined."]
3141 MAV_ODID_UA_TYPE_NONE = 0,
3142 #[doc = "Aeroplane/Airplane. Fixed wing."]
3143 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3144 #[doc = "Helicopter or multirotor."]
3145 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3146 #[doc = "Gyroplane."]
3147 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3148 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3149 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3150 #[doc = "Ornithopter."]
3151 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3152 #[doc = "Glider."]
3153 MAV_ODID_UA_TYPE_GLIDER = 6,
3154 #[doc = "Kite."]
3155 MAV_ODID_UA_TYPE_KITE = 7,
3156 #[doc = "Free Balloon."]
3157 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3158 #[doc = "Captive Balloon."]
3159 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3160 #[doc = "Airship. E.g. a blimp."]
3161 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3162 #[doc = "Free Fall/Parachute (unpowered)."]
3163 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3164 #[doc = "Rocket."]
3165 MAV_ODID_UA_TYPE_ROCKET = 12,
3166 #[doc = "Tethered powered aircraft."]
3167 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3168 #[doc = "Ground Obstacle."]
3169 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3170 #[doc = "Other type of aircraft not listed earlier."]
3171 MAV_ODID_UA_TYPE_OTHER = 15,
3172}
3173impl MavOdidUaType {
3174 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3175}
3176impl Default for MavOdidUaType {
3177 fn default() -> Self {
3178 Self::DEFAULT
3179 }
3180}
3181#[cfg_attr(feature = "ts", derive(TS))]
3182#[cfg_attr(feature = "ts", ts(export))]
3183#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3185#[cfg_attr(feature = "serde", serde(tag = "type"))]
3186#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3187#[repr(u32)]
3188pub enum MavOdidVerAcc {
3189 #[doc = "The vertical accuracy is unknown."]
3190 MAV_ODID_VER_ACC_UNKNOWN = 0,
3191 #[doc = "The vertical accuracy is smaller than 150 meter."]
3192 MAV_ODID_VER_ACC_150_METER = 1,
3193 #[doc = "The vertical accuracy is smaller than 45 meter."]
3194 MAV_ODID_VER_ACC_45_METER = 2,
3195 #[doc = "The vertical accuracy is smaller than 25 meter."]
3196 MAV_ODID_VER_ACC_25_METER = 3,
3197 #[doc = "The vertical accuracy is smaller than 10 meter."]
3198 MAV_ODID_VER_ACC_10_METER = 4,
3199 #[doc = "The vertical accuracy is smaller than 3 meter."]
3200 MAV_ODID_VER_ACC_3_METER = 5,
3201 #[doc = "The vertical accuracy is smaller than 1 meter."]
3202 MAV_ODID_VER_ACC_1_METER = 6,
3203}
3204impl MavOdidVerAcc {
3205 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3206}
3207impl Default for MavOdidVerAcc {
3208 fn default() -> Self {
3209 Self::DEFAULT
3210 }
3211}
3212#[cfg_attr(feature = "ts", derive(TS))]
3213#[cfg_attr(feature = "ts", ts(export))]
3214#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3216#[cfg_attr(feature = "serde", serde(tag = "type"))]
3217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3218#[repr(u32)]
3219#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3220pub enum MavParamExtType {
3221 #[doc = "8-bit unsigned integer"]
3222 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3223 #[doc = "8-bit signed integer"]
3224 MAV_PARAM_EXT_TYPE_INT8 = 2,
3225 #[doc = "16-bit unsigned integer"]
3226 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3227 #[doc = "16-bit signed integer"]
3228 MAV_PARAM_EXT_TYPE_INT16 = 4,
3229 #[doc = "32-bit unsigned integer"]
3230 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3231 #[doc = "32-bit signed integer"]
3232 MAV_PARAM_EXT_TYPE_INT32 = 6,
3233 #[doc = "64-bit unsigned integer"]
3234 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3235 #[doc = "64-bit signed integer"]
3236 MAV_PARAM_EXT_TYPE_INT64 = 8,
3237 #[doc = "32-bit floating-point"]
3238 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3239 #[doc = "64-bit floating-point"]
3240 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3241 #[doc = "Custom Type"]
3242 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3243}
3244impl MavParamExtType {
3245 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3246}
3247impl Default for MavParamExtType {
3248 fn default() -> Self {
3249 Self::DEFAULT
3250 }
3251}
3252#[cfg_attr(feature = "ts", derive(TS))]
3253#[cfg_attr(feature = "ts", ts(export))]
3254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3256#[cfg_attr(feature = "serde", serde(tag = "type"))]
3257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3258#[repr(u32)]
3259#[doc = "Specifies the datatype of a MAVLink parameter."]
3260pub enum MavParamType {
3261 #[doc = "8-bit unsigned integer"]
3262 MAV_PARAM_TYPE_UINT8 = 1,
3263 #[doc = "8-bit signed integer"]
3264 MAV_PARAM_TYPE_INT8 = 2,
3265 #[doc = "16-bit unsigned integer"]
3266 MAV_PARAM_TYPE_UINT16 = 3,
3267 #[doc = "16-bit signed integer"]
3268 MAV_PARAM_TYPE_INT16 = 4,
3269 #[doc = "32-bit unsigned integer"]
3270 MAV_PARAM_TYPE_UINT32 = 5,
3271 #[doc = "32-bit signed integer"]
3272 MAV_PARAM_TYPE_INT32 = 6,
3273 #[doc = "64-bit unsigned integer"]
3274 MAV_PARAM_TYPE_UINT64 = 7,
3275 #[doc = "64-bit signed integer"]
3276 MAV_PARAM_TYPE_INT64 = 8,
3277 #[doc = "32-bit floating-point"]
3278 MAV_PARAM_TYPE_REAL32 = 9,
3279 #[doc = "64-bit floating-point"]
3280 MAV_PARAM_TYPE_REAL64 = 10,
3281}
3282impl MavParamType {
3283 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3284}
3285impl Default for MavParamType {
3286 fn default() -> Self {
3287 Self::DEFAULT
3288 }
3289}
3290bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3291impl MavPowerStatus {
3292 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3293}
3294impl Default for MavPowerStatus {
3295 fn default() -> Self {
3296 Self::DEFAULT
3297 }
3298}
3299bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3300impl MavProtocolCapability {
3301 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3302}
3303impl Default for MavProtocolCapability {
3304 fn default() -> Self {
3305 Self::DEFAULT
3306 }
3307}
3308#[cfg_attr(feature = "ts", derive(TS))]
3309#[cfg_attr(feature = "ts", ts(export))]
3310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3312#[cfg_attr(feature = "serde", serde(tag = "type"))]
3313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3314#[repr(u32)]
3315#[doc = "Result from a MAVLink command (MAV_CMD)"]
3316pub enum MavResult {
3317 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3318 MAV_RESULT_ACCEPTED = 0,
3319 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3320 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3321 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3322 MAV_RESULT_DENIED = 2,
3323 #[doc = "Command is not supported (unknown)."]
3324 MAV_RESULT_UNSUPPORTED = 3,
3325 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3326 MAV_RESULT_FAILED = 4,
3327 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3328 MAV_RESULT_IN_PROGRESS = 5,
3329 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3330 MAV_RESULT_CANCELLED = 6,
3331 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3332 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3333 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3334 MAV_RESULT_COMMAND_INT_ONLY = 8,
3335 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3336 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3337}
3338impl MavResult {
3339 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3340}
3341impl Default for MavResult {
3342 fn default() -> Self {
3343 Self::DEFAULT
3344 }
3345}
3346#[cfg_attr(feature = "ts", derive(TS))]
3347#[cfg_attr(feature = "ts", ts(export))]
3348#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3350#[cfg_attr(feature = "serde", serde(tag = "type"))]
3351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3352#[repr(u32)]
3353#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3354#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3355pub enum MavRoi {
3356 #[doc = "No region of interest."]
3357 MAV_ROI_NONE = 0,
3358 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3359 MAV_ROI_WPNEXT = 1,
3360 #[doc = "Point toward given waypoint."]
3361 MAV_ROI_WPINDEX = 2,
3362 #[doc = "Point toward fixed location."]
3363 MAV_ROI_LOCATION = 3,
3364 #[doc = "Point toward of given id."]
3365 MAV_ROI_TARGET = 4,
3366}
3367impl MavRoi {
3368 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3369}
3370impl Default for MavRoi {
3371 fn default() -> Self {
3372 Self::DEFAULT
3373 }
3374}
3375#[cfg_attr(feature = "ts", derive(TS))]
3376#[cfg_attr(feature = "ts", ts(export))]
3377#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3378#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3379#[cfg_attr(feature = "serde", serde(tag = "type"))]
3380#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3381#[repr(u32)]
3382#[doc = "Enumeration of sensor orientation, according to its rotations"]
3383pub enum MavSensorOrientation {
3384 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3385 MAV_SENSOR_ROTATION_NONE = 0,
3386 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3387 MAV_SENSOR_ROTATION_YAW_45 = 1,
3388 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3389 MAV_SENSOR_ROTATION_YAW_90 = 2,
3390 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3391 MAV_SENSOR_ROTATION_YAW_135 = 3,
3392 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3393 MAV_SENSOR_ROTATION_YAW_180 = 4,
3394 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3395 MAV_SENSOR_ROTATION_YAW_225 = 5,
3396 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3397 MAV_SENSOR_ROTATION_YAW_270 = 6,
3398 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3399 MAV_SENSOR_ROTATION_YAW_315 = 7,
3400 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3401 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3402 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3403 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3404 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3405 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3406 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3407 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3408 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3409 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3410 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3411 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3412 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3413 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3414 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3415 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3416 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3417 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3418 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3419 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3420 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3421 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3422 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3423 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3424 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3425 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3426 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3427 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3428 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3429 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3430 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3431 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3432 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3433 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3434 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3435 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3436 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3437 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3438 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3439 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3440 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3441 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3442 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3443 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3444 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3445 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3446 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3447 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3448 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3449 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3450 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3451 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3452 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3453 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3454 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3455 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3456 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3457 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3458 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3459 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3460 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3461 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3462 #[doc = "Pitch: 315"]
3463 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3464 #[doc = "Roll: 90, Pitch: 315"]
3465 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3466 #[doc = "Custom orientation"]
3467 MAV_SENSOR_ROTATION_CUSTOM = 100,
3468}
3469impl MavSensorOrientation {
3470 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3471}
3472impl Default for MavSensorOrientation {
3473 fn default() -> Self {
3474 Self::DEFAULT
3475 }
3476}
3477#[cfg_attr(feature = "ts", derive(TS))]
3478#[cfg_attr(feature = "ts", ts(export))]
3479#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3481#[cfg_attr(feature = "serde", serde(tag = "type"))]
3482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3483#[repr(u32)]
3484#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3485pub enum MavSeverity {
3486 #[doc = "System is unusable. This is a \"panic\" condition."]
3487 MAV_SEVERITY_EMERGENCY = 0,
3488 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3489 MAV_SEVERITY_ALERT = 1,
3490 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3491 MAV_SEVERITY_CRITICAL = 2,
3492 #[doc = "Indicates an error in secondary/redundant systems."]
3493 MAV_SEVERITY_ERROR = 3,
3494 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3495 MAV_SEVERITY_WARNING = 4,
3496 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3497 MAV_SEVERITY_NOTICE = 5,
3498 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3499 MAV_SEVERITY_INFO = 6,
3500 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3501 MAV_SEVERITY_DEBUG = 7,
3502}
3503impl MavSeverity {
3504 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3505}
3506impl Default for MavSeverity {
3507 fn default() -> Self {
3508 Self::DEFAULT
3509 }
3510}
3511#[cfg_attr(feature = "ts", derive(TS))]
3512#[cfg_attr(feature = "ts", ts(export))]
3513#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3514#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3515#[cfg_attr(feature = "serde", serde(tag = "type"))]
3516#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3517#[repr(u32)]
3518#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3519pub enum MavStandardMode {
3520 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3521 MAV_STANDARD_MODE_NON_STANDARD = 0,
3522 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3523 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3524 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3525 MAV_STANDARD_MODE_ORBIT = 2,
3526 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3527 MAV_STANDARD_MODE_CRUISE = 3,
3528 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3529 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3530 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3531 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3532 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3533 MAV_STANDARD_MODE_MISSION = 6,
3534 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3535 MAV_STANDARD_MODE_LAND = 7,
3536 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3537 MAV_STANDARD_MODE_TAKEOFF = 8,
3538}
3539impl MavStandardMode {
3540 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3541}
3542impl Default for MavStandardMode {
3543 fn default() -> Self {
3544 Self::DEFAULT
3545 }
3546}
3547#[cfg_attr(feature = "ts", derive(TS))]
3548#[cfg_attr(feature = "ts", ts(export))]
3549#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3550#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3551#[cfg_attr(feature = "serde", serde(tag = "type"))]
3552#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3553#[repr(u32)]
3554pub enum MavState {
3555 #[doc = "Uninitialized system, state is unknown."]
3556 MAV_STATE_UNINIT = 0,
3557 #[doc = "System is booting up."]
3558 MAV_STATE_BOOT = 1,
3559 #[doc = "System is calibrating and not flight-ready."]
3560 MAV_STATE_CALIBRATING = 2,
3561 #[doc = "System is grounded and on standby. It can be launched any time."]
3562 MAV_STATE_STANDBY = 3,
3563 #[doc = "System is active and might be already airborne. Motors are engaged."]
3564 MAV_STATE_ACTIVE = 4,
3565 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3566 MAV_STATE_CRITICAL = 5,
3567 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3568 MAV_STATE_EMERGENCY = 6,
3569 #[doc = "System just initialized its power-down sequence, will shut down now."]
3570 MAV_STATE_POWEROFF = 7,
3571 #[doc = "System is terminating itself (failsafe or commanded)."]
3572 MAV_STATE_FLIGHT_TERMINATION = 8,
3573}
3574impl MavState {
3575 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3576}
3577impl Default for MavState {
3578 fn default() -> Self {
3579 Self::DEFAULT
3580 }
3581}
3582bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3583impl MavSysStatusSensor {
3584 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3585}
3586impl Default for MavSysStatusSensor {
3587 fn default() -> Self {
3588 Self::DEFAULT
3589 }
3590}
3591bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3592impl MavSysStatusSensorExtended {
3593 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3594}
3595impl Default for MavSysStatusSensorExtended {
3596 fn default() -> Self {
3597 Self::DEFAULT
3598 }
3599}
3600#[cfg_attr(feature = "ts", derive(TS))]
3601#[cfg_attr(feature = "ts", ts(export))]
3602#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3603#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3604#[cfg_attr(feature = "serde", serde(tag = "type"))]
3605#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3606#[repr(u32)]
3607pub enum MavTunnelPayloadType {
3608 #[doc = "Encoding of payload unknown."]
3609 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3610 #[doc = "Registered for STorM32 gimbal controller."]
3611 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3612 #[doc = "Registered for STorM32 gimbal controller."]
3613 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3614 #[doc = "Registered for STorM32 gimbal controller."]
3615 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3616 #[doc = "Registered for STorM32 gimbal controller."]
3617 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3618 #[doc = "Registered for STorM32 gimbal controller."]
3619 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3620 #[doc = "Registered for STorM32 gimbal controller."]
3621 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3622 #[doc = "Registered for STorM32 gimbal controller."]
3623 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3624 #[doc = "Registered for STorM32 gimbal controller."]
3625 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3626 #[doc = "Registered for STorM32 gimbal controller."]
3627 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3628 #[doc = "Registered for STorM32 gimbal controller."]
3629 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3630 #[doc = "Registered for ModalAI remote OSD protocol."]
3631 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3632 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3633 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3634 #[doc = "Registered for ModalAI vendor use."]
3635 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3636}
3637impl MavTunnelPayloadType {
3638 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3639}
3640impl Default for MavTunnelPayloadType {
3641 fn default() -> Self {
3642 Self::DEFAULT
3643 }
3644}
3645#[cfg_attr(feature = "ts", derive(TS))]
3646#[cfg_attr(feature = "ts", ts(export))]
3647#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3649#[cfg_attr(feature = "serde", serde(tag = "type"))]
3650#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3651#[repr(u32)]
3652#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3653pub enum MavType {
3654 #[doc = "Generic micro air vehicle"]
3655 MAV_TYPE_GENERIC = 0,
3656 #[doc = "Fixed wing aircraft."]
3657 MAV_TYPE_FIXED_WING = 1,
3658 #[doc = "Quadrotor"]
3659 MAV_TYPE_QUADROTOR = 2,
3660 #[doc = "Coaxial helicopter"]
3661 MAV_TYPE_COAXIAL = 3,
3662 #[doc = "Normal helicopter with tail rotor."]
3663 MAV_TYPE_HELICOPTER = 4,
3664 #[doc = "Ground installation"]
3665 MAV_TYPE_ANTENNA_TRACKER = 5,
3666 #[doc = "Operator control unit / ground control station"]
3667 MAV_TYPE_GCS = 6,
3668 #[doc = "Airship, controlled"]
3669 MAV_TYPE_AIRSHIP = 7,
3670 #[doc = "Free balloon, uncontrolled"]
3671 MAV_TYPE_FREE_BALLOON = 8,
3672 #[doc = "Rocket"]
3673 MAV_TYPE_ROCKET = 9,
3674 #[doc = "Ground rover"]
3675 MAV_TYPE_GROUND_ROVER = 10,
3676 #[doc = "Surface vessel, boat, ship"]
3677 MAV_TYPE_SURFACE_BOAT = 11,
3678 #[doc = "Submarine"]
3679 MAV_TYPE_SUBMARINE = 12,
3680 #[doc = "Hexarotor"]
3681 MAV_TYPE_HEXAROTOR = 13,
3682 #[doc = "Octorotor"]
3683 MAV_TYPE_OCTOROTOR = 14,
3684 #[doc = "Tricopter"]
3685 MAV_TYPE_TRICOPTER = 15,
3686 #[doc = "Flapping wing"]
3687 MAV_TYPE_FLAPPING_WING = 16,
3688 #[doc = "Kite"]
3689 MAV_TYPE_KITE = 17,
3690 #[doc = "Onboard companion controller"]
3691 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3692 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3693 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3694 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3695 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3696 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3697 MAV_TYPE_VTOL_TILTROTOR = 21,
3698 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3699 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3700 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3701 MAV_TYPE_VTOL_TAILSITTER = 23,
3702 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3703 MAV_TYPE_VTOL_TILTWING = 24,
3704 #[doc = "VTOL reserved 5"]
3705 MAV_TYPE_VTOL_RESERVED5 = 25,
3706 #[doc = "Gimbal"]
3707 MAV_TYPE_GIMBAL = 26,
3708 #[doc = "ADSB system"]
3709 MAV_TYPE_ADSB = 27,
3710 #[doc = "Steerable, nonrigid airfoil"]
3711 MAV_TYPE_PARAFOIL = 28,
3712 #[doc = "Dodecarotor"]
3713 MAV_TYPE_DODECAROTOR = 29,
3714 #[doc = "Camera"]
3715 MAV_TYPE_CAMERA = 30,
3716 #[doc = "Charging station"]
3717 MAV_TYPE_CHARGING_STATION = 31,
3718 #[doc = "FLARM collision avoidance system"]
3719 MAV_TYPE_FLARM = 32,
3720 #[doc = "Servo"]
3721 MAV_TYPE_SERVO = 33,
3722 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3723 MAV_TYPE_ODID = 34,
3724 #[doc = "Decarotor"]
3725 MAV_TYPE_DECAROTOR = 35,
3726 #[doc = "Battery"]
3727 MAV_TYPE_BATTERY = 36,
3728 #[doc = "Parachute"]
3729 MAV_TYPE_PARACHUTE = 37,
3730 #[doc = "Log"]
3731 MAV_TYPE_LOG = 38,
3732 #[doc = "OSD"]
3733 MAV_TYPE_OSD = 39,
3734 #[doc = "IMU"]
3735 MAV_TYPE_IMU = 40,
3736 #[doc = "GPS"]
3737 MAV_TYPE_GPS = 41,
3738 #[doc = "Winch"]
3739 MAV_TYPE_WINCH = 42,
3740 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3741 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3742 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3743 MAV_TYPE_ILLUMINATOR = 44,
3744 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3745 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3746}
3747impl MavType {
3748 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3749}
3750impl Default for MavType {
3751 fn default() -> Self {
3752 Self::DEFAULT
3753 }
3754}
3755#[cfg_attr(feature = "ts", derive(TS))]
3756#[cfg_attr(feature = "ts", ts(export))]
3757#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3759#[cfg_attr(feature = "serde", serde(tag = "type"))]
3760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3761#[repr(u32)]
3762#[doc = "Enumeration of VTOL states"]
3763pub enum MavVtolState {
3764 #[doc = "MAV is not configured as VTOL"]
3765 MAV_VTOL_STATE_UNDEFINED = 0,
3766 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3767 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3768 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3769 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3770 #[doc = "VTOL is in multicopter state"]
3771 MAV_VTOL_STATE_MC = 3,
3772 #[doc = "VTOL is in fixed-wing state"]
3773 MAV_VTOL_STATE_FW = 4,
3774}
3775impl MavVtolState {
3776 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3777}
3778impl Default for MavVtolState {
3779 fn default() -> Self {
3780 Self::DEFAULT
3781 }
3782}
3783bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3784impl MavWinchStatusFlag {
3785 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3786}
3787impl Default for MavWinchStatusFlag {
3788 fn default() -> Self {
3789 Self::DEFAULT
3790 }
3791}
3792#[cfg_attr(feature = "ts", derive(TS))]
3793#[cfg_attr(feature = "ts", ts(export))]
3794#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3796#[cfg_attr(feature = "serde", serde(tag = "type"))]
3797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3798#[repr(u32)]
3799pub enum MavlinkDataStreamType {
3800 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3801 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3802 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3803 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3804 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3805 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3806}
3807impl MavlinkDataStreamType {
3808 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3809}
3810impl Default for MavlinkDataStreamType {
3811 fn default() -> Self {
3812 Self::DEFAULT
3813 }
3814}
3815#[cfg_attr(feature = "ts", derive(TS))]
3816#[cfg_attr(feature = "ts", ts(export))]
3817#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3819#[cfg_attr(feature = "serde", serde(tag = "type"))]
3820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3821#[repr(u32)]
3822#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3823pub enum MissionState {
3824 #[doc = "The mission status reporting is not supported."]
3825 MISSION_STATE_UNKNOWN = 0,
3826 #[doc = "No mission on the vehicle."]
3827 MISSION_STATE_NO_MISSION = 1,
3828 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3829 MISSION_STATE_NOT_STARTED = 2,
3830 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3831 MISSION_STATE_ACTIVE = 3,
3832 #[doc = "Mission is paused when in auto mode."]
3833 MISSION_STATE_PAUSED = 4,
3834 #[doc = "Mission has executed all mission items."]
3835 MISSION_STATE_COMPLETE = 5,
3836}
3837impl MissionState {
3838 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3839}
3840impl Default for MissionState {
3841 fn default() -> Self {
3842 Self::DEFAULT
3843 }
3844}
3845#[cfg_attr(feature = "ts", derive(TS))]
3846#[cfg_attr(feature = "ts", ts(export))]
3847#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3849#[cfg_attr(feature = "serde", serde(tag = "type"))]
3850#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3851#[repr(u32)]
3852#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3853pub enum MotorTestOrder {
3854 #[doc = "Default autopilot motor test method."]
3855 MOTOR_TEST_ORDER_DEFAULT = 0,
3856 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3857 MOTOR_TEST_ORDER_SEQUENCE = 1,
3858 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3859 MOTOR_TEST_ORDER_BOARD = 2,
3860}
3861impl MotorTestOrder {
3862 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3863}
3864impl Default for MotorTestOrder {
3865 fn default() -> Self {
3866 Self::DEFAULT
3867 }
3868}
3869#[cfg_attr(feature = "ts", derive(TS))]
3870#[cfg_attr(feature = "ts", ts(export))]
3871#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3872#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3873#[cfg_attr(feature = "serde", serde(tag = "type"))]
3874#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3875#[repr(u32)]
3876#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3877pub enum MotorTestThrottleType {
3878 #[doc = "Throttle as a percentage (0 ~ 100)"]
3879 MOTOR_TEST_THROTTLE_PERCENT = 0,
3880 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3881 MOTOR_TEST_THROTTLE_PWM = 1,
3882 #[doc = "Throttle pass-through from pilot's transmitter."]
3883 MOTOR_TEST_THROTTLE_PILOT = 2,
3884 #[doc = "Per-motor compass calibration test."]
3885 MOTOR_TEST_COMPASS_CAL = 3,
3886}
3887impl MotorTestThrottleType {
3888 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3889}
3890impl Default for MotorTestThrottleType {
3891 fn default() -> Self {
3892 Self::DEFAULT
3893 }
3894}
3895#[cfg_attr(feature = "ts", derive(TS))]
3896#[cfg_attr(feature = "ts", ts(export))]
3897#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3898#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3899#[cfg_attr(feature = "serde", serde(tag = "type"))]
3900#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3901#[repr(u32)]
3902pub enum NavVtolLandOptions {
3903 #[doc = "Default autopilot landing behaviour."]
3904 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3905 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3906 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3907 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3908 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3909}
3910impl NavVtolLandOptions {
3911 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3912}
3913impl Default for NavVtolLandOptions {
3914 fn default() -> Self {
3915 Self::DEFAULT
3916 }
3917}
3918#[cfg_attr(feature = "ts", derive(TS))]
3919#[cfg_attr(feature = "ts", ts(export))]
3920#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3922#[cfg_attr(feature = "serde", serde(tag = "type"))]
3923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3924#[repr(u32)]
3925#[doc = "Yaw behaviour during orbit flight."]
3926pub enum OrbitYawBehaviour {
3927 #[doc = "Vehicle front points to the center (default)."]
3928 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3929 #[doc = "Vehicle front holds heading when message received."]
3930 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3931 #[doc = "Yaw uncontrolled."]
3932 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3933 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3934 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3935 #[doc = "Yaw controlled by RC input."]
3936 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3937 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3938 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3939}
3940impl OrbitYawBehaviour {
3941 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3942}
3943impl Default for OrbitYawBehaviour {
3944 fn default() -> Self {
3945 Self::DEFAULT
3946 }
3947}
3948#[cfg_attr(feature = "ts", derive(TS))]
3949#[cfg_attr(feature = "ts", ts(export))]
3950#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3951#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3952#[cfg_attr(feature = "serde", serde(tag = "type"))]
3953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3954#[repr(u32)]
3955#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3956pub enum ParachuteAction {
3957 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3958 PARACHUTE_DISABLE = 0,
3959 #[doc = "Enable auto-release of parachute."]
3960 PARACHUTE_ENABLE = 1,
3961 #[doc = "Release parachute and kill motors."]
3962 PARACHUTE_RELEASE = 2,
3963}
3964impl ParachuteAction {
3965 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3966}
3967impl Default for ParachuteAction {
3968 fn default() -> Self {
3969 Self::DEFAULT
3970 }
3971}
3972#[cfg_attr(feature = "ts", derive(TS))]
3973#[cfg_attr(feature = "ts", ts(export))]
3974#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3975#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3976#[cfg_attr(feature = "serde", serde(tag = "type"))]
3977#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3978#[repr(u32)]
3979#[doc = "Result from PARAM_EXT_SET message."]
3980pub enum ParamAck {
3981 #[doc = "Parameter value ACCEPTED and SET"]
3982 PARAM_ACK_ACCEPTED = 0,
3983 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3984 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3985 #[doc = "Parameter failed to set"]
3986 PARAM_ACK_FAILED = 2,
3987 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3988 PARAM_ACK_IN_PROGRESS = 3,
3989}
3990impl ParamAck {
3991 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3992}
3993impl Default for ParamAck {
3994 fn default() -> Self {
3995 Self::DEFAULT
3996 }
3997}
3998bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3999impl PositionTargetTypemask {
4000 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
4001}
4002impl Default for PositionTargetTypemask {
4003 fn default() -> Self {
4004 Self::DEFAULT
4005 }
4006}
4007#[cfg_attr(feature = "ts", derive(TS))]
4008#[cfg_attr(feature = "ts", ts(export))]
4009#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4010#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4011#[cfg_attr(feature = "serde", serde(tag = "type"))]
4012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4013#[repr(u32)]
4014#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
4015pub enum PrecisionLandMode {
4016 #[doc = "Normal (non-precision) landing."]
4017 PRECISION_LAND_MODE_DISABLED = 0,
4018 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
4019 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
4020 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
4021 PRECISION_LAND_MODE_REQUIRED = 2,
4022}
4023impl PrecisionLandMode {
4024 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
4025}
4026impl Default for PrecisionLandMode {
4027 fn default() -> Self {
4028 Self::DEFAULT
4029 }
4030}
4031#[cfg_attr(feature = "ts", derive(TS))]
4032#[cfg_attr(feature = "ts", ts(export))]
4033#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4035#[cfg_attr(feature = "serde", serde(tag = "type"))]
4036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4037#[repr(u32)]
4038#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4039pub enum PreflightStorageMissionAction {
4040 #[doc = "Read current mission data from persistent storage"]
4041 MISSION_READ_PERSISTENT = 0,
4042 #[doc = "Write current mission data to persistent storage"]
4043 MISSION_WRITE_PERSISTENT = 1,
4044 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4045 MISSION_RESET_DEFAULT = 2,
4046}
4047impl PreflightStorageMissionAction {
4048 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4049}
4050impl Default for PreflightStorageMissionAction {
4051 fn default() -> Self {
4052 Self::DEFAULT
4053 }
4054}
4055#[cfg_attr(feature = "ts", derive(TS))]
4056#[cfg_attr(feature = "ts", ts(export))]
4057#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4058#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4059#[cfg_attr(feature = "serde", serde(tag = "type"))]
4060#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4061#[repr(u32)]
4062#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4063pub enum PreflightStorageParameterAction {
4064 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4065 PARAM_READ_PERSISTENT = 0,
4066 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4067 PARAM_WRITE_PERSISTENT = 1,
4068 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4069 PARAM_RESET_CONFIG_DEFAULT = 2,
4070 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4071 PARAM_RESET_SENSOR_DEFAULT = 3,
4072 #[doc = "Reset all parameters, including operation counters, to default values"]
4073 PARAM_RESET_ALL_DEFAULT = 4,
4074}
4075impl PreflightStorageParameterAction {
4076 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4077}
4078impl Default for PreflightStorageParameterAction {
4079 fn default() -> Self {
4080 Self::DEFAULT
4081 }
4082}
4083#[cfg_attr(feature = "ts", derive(TS))]
4084#[cfg_attr(feature = "ts", ts(export))]
4085#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4087#[cfg_attr(feature = "serde", serde(tag = "type"))]
4088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4089#[repr(u32)]
4090#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4091pub enum RcSubType {
4092 #[doc = "Spektrum DSM2"]
4093 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4094 #[doc = "Spektrum DSMX"]
4095 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4096 #[doc = "Spektrum DSMX8"]
4097 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4098}
4099impl RcSubType {
4100 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4101}
4102impl Default for RcSubType {
4103 fn default() -> Self {
4104 Self::DEFAULT
4105 }
4106}
4107#[cfg_attr(feature = "ts", derive(TS))]
4108#[cfg_attr(feature = "ts", ts(export))]
4109#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4110#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4111#[cfg_attr(feature = "serde", serde(tag = "type"))]
4112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4113#[repr(u32)]
4114#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4115pub enum RcType {
4116 #[doc = "Spektrum"]
4117 RC_TYPE_SPEKTRUM = 0,
4118 #[doc = "CRSF"]
4119 RC_TYPE_CRSF = 1,
4120}
4121impl RcType {
4122 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4123}
4124impl Default for RcType {
4125 fn default() -> Self {
4126 Self::DEFAULT
4127 }
4128}
4129#[cfg_attr(feature = "ts", derive(TS))]
4130#[cfg_attr(feature = "ts", ts(export))]
4131#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4132#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4133#[cfg_attr(feature = "serde", serde(tag = "type"))]
4134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4135#[repr(u32)]
4136#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4137pub enum RebootShutdownConditions {
4138 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4139 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4140 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4141 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4142}
4143impl RebootShutdownConditions {
4144 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4145}
4146impl Default for RebootShutdownConditions {
4147 fn default() -> Self {
4148 Self::DEFAULT
4149 }
4150}
4151#[cfg_attr(feature = "ts", derive(TS))]
4152#[cfg_attr(feature = "ts", ts(export))]
4153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4155#[cfg_attr(feature = "serde", serde(tag = "type"))]
4156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4157#[repr(u32)]
4158#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4159pub enum RtkBaselineCoordinateSystem {
4160 #[doc = "Earth-centered, Earth-fixed"]
4161 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4162 #[doc = "RTK basestation centered, north, east, down"]
4163 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4164}
4165impl RtkBaselineCoordinateSystem {
4166 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4167}
4168impl Default for RtkBaselineCoordinateSystem {
4169 fn default() -> Self {
4170 Self::DEFAULT
4171 }
4172}
4173#[cfg_attr(feature = "ts", derive(TS))]
4174#[cfg_attr(feature = "ts", ts(export))]
4175#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4176#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4177#[cfg_attr(feature = "serde", serde(tag = "type"))]
4178#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4179#[repr(u32)]
4180#[doc = "Possible safety switch states."]
4181pub enum SafetySwitchState {
4182 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4183 SAFETY_SWITCH_STATE_SAFE = 0,
4184 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4185 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4186}
4187impl SafetySwitchState {
4188 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4189}
4190impl Default for SafetySwitchState {
4191 fn default() -> Self {
4192 Self::DEFAULT
4193 }
4194}
4195#[cfg_attr(feature = "ts", derive(TS))]
4196#[cfg_attr(feature = "ts", ts(export))]
4197#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4198#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4199#[cfg_attr(feature = "serde", serde(tag = "type"))]
4200#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4201#[repr(u32)]
4202#[doc = "SERIAL_CONTROL device types"]
4203pub enum SerialControlDev {
4204 #[doc = "First telemetry port"]
4205 SERIAL_CONTROL_DEV_TELEM1 = 0,
4206 #[doc = "Second telemetry port"]
4207 SERIAL_CONTROL_DEV_TELEM2 = 1,
4208 #[doc = "First GPS port"]
4209 SERIAL_CONTROL_DEV_GPS1 = 2,
4210 #[doc = "Second GPS port"]
4211 SERIAL_CONTROL_DEV_GPS2 = 3,
4212 #[doc = "system shell"]
4213 SERIAL_CONTROL_DEV_SHELL = 10,
4214 #[doc = "SERIAL0"]
4215 SERIAL_CONTROL_SERIAL0 = 100,
4216 #[doc = "SERIAL1"]
4217 SERIAL_CONTROL_SERIAL1 = 101,
4218 #[doc = "SERIAL2"]
4219 SERIAL_CONTROL_SERIAL2 = 102,
4220 #[doc = "SERIAL3"]
4221 SERIAL_CONTROL_SERIAL3 = 103,
4222 #[doc = "SERIAL4"]
4223 SERIAL_CONTROL_SERIAL4 = 104,
4224 #[doc = "SERIAL5"]
4225 SERIAL_CONTROL_SERIAL5 = 105,
4226 #[doc = "SERIAL6"]
4227 SERIAL_CONTROL_SERIAL6 = 106,
4228 #[doc = "SERIAL7"]
4229 SERIAL_CONTROL_SERIAL7 = 107,
4230 #[doc = "SERIAL8"]
4231 SERIAL_CONTROL_SERIAL8 = 108,
4232 #[doc = "SERIAL9"]
4233 SERIAL_CONTROL_SERIAL9 = 109,
4234}
4235impl SerialControlDev {
4236 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4237}
4238impl Default for SerialControlDev {
4239 fn default() -> Self {
4240 Self::DEFAULT
4241 }
4242}
4243bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4244impl SerialControlFlag {
4245 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4246}
4247impl Default for SerialControlFlag {
4248 fn default() -> Self {
4249 Self::DEFAULT
4250 }
4251}
4252#[cfg_attr(feature = "ts", derive(TS))]
4253#[cfg_attr(feature = "ts", ts(export))]
4254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4256#[cfg_attr(feature = "serde", serde(tag = "type"))]
4257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4258#[repr(u32)]
4259#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4260pub enum SetFocusType {
4261 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4262 FOCUS_TYPE_STEP = 0,
4263 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4264 FOCUS_TYPE_CONTINUOUS = 1,
4265 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4266 FOCUS_TYPE_RANGE = 2,
4267 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4268 FOCUS_TYPE_METERS = 3,
4269 #[doc = "Focus automatically."]
4270 FOCUS_TYPE_AUTO = 4,
4271 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4272 FOCUS_TYPE_AUTO_SINGLE = 5,
4273 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4274 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4275}
4276impl SetFocusType {
4277 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4278}
4279impl Default for SetFocusType {
4280 fn default() -> Self {
4281 Self::DEFAULT
4282 }
4283}
4284#[cfg_attr(feature = "ts", derive(TS))]
4285#[cfg_attr(feature = "ts", ts(export))]
4286#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4287#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4288#[cfg_attr(feature = "serde", serde(tag = "type"))]
4289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4290#[repr(u32)]
4291#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4292pub enum SpeedType {
4293 #[doc = "Airspeed"]
4294 SPEED_TYPE_AIRSPEED = 0,
4295 #[doc = "Groundspeed"]
4296 SPEED_TYPE_GROUNDSPEED = 1,
4297 #[doc = "Climb speed"]
4298 SPEED_TYPE_CLIMB_SPEED = 2,
4299 #[doc = "Descent speed"]
4300 SPEED_TYPE_DESCENT_SPEED = 3,
4301}
4302impl SpeedType {
4303 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4304}
4305impl Default for SpeedType {
4306 fn default() -> Self {
4307 Self::DEFAULT
4308 }
4309}
4310#[cfg_attr(feature = "ts", derive(TS))]
4311#[cfg_attr(feature = "ts", ts(export))]
4312#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4314#[cfg_attr(feature = "serde", serde(tag = "type"))]
4315#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4316#[repr(u32)]
4317#[doc = "Flags to indicate the status of camera storage."]
4318pub enum StorageStatus {
4319 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4320 STORAGE_STATUS_EMPTY = 0,
4321 #[doc = "Storage present but unformatted."]
4322 STORAGE_STATUS_UNFORMATTED = 1,
4323 #[doc = "Storage present and ready."]
4324 STORAGE_STATUS_READY = 2,
4325 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4326 STORAGE_STATUS_NOT_SUPPORTED = 3,
4327}
4328impl StorageStatus {
4329 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4330}
4331impl Default for StorageStatus {
4332 fn default() -> Self {
4333 Self::DEFAULT
4334 }
4335}
4336#[cfg_attr(feature = "ts", derive(TS))]
4337#[cfg_attr(feature = "ts", ts(export))]
4338#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4340#[cfg_attr(feature = "serde", serde(tag = "type"))]
4341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4342#[repr(u32)]
4343#[doc = "Flags to indicate the type of storage."]
4344pub enum StorageType {
4345 #[doc = "Storage type is not known."]
4346 STORAGE_TYPE_UNKNOWN = 0,
4347 #[doc = "Storage type is USB device."]
4348 STORAGE_TYPE_USB_STICK = 1,
4349 #[doc = "Storage type is SD card."]
4350 STORAGE_TYPE_SD = 2,
4351 #[doc = "Storage type is microSD card."]
4352 STORAGE_TYPE_MICROSD = 3,
4353 #[doc = "Storage type is CFast."]
4354 STORAGE_TYPE_CF = 4,
4355 #[doc = "Storage type is CFexpress."]
4356 STORAGE_TYPE_CFE = 5,
4357 #[doc = "Storage type is XQD."]
4358 STORAGE_TYPE_XQD = 6,
4359 #[doc = "Storage type is HD mass storage type."]
4360 STORAGE_TYPE_HD = 7,
4361 #[doc = "Storage type is other, not listed type."]
4362 STORAGE_TYPE_OTHER = 254,
4363}
4364impl StorageType {
4365 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4366}
4367impl Default for StorageType {
4368 fn default() -> Self {
4369 Self::DEFAULT
4370 }
4371}
4372bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4373impl StorageUsageFlag {
4374 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4375}
4376impl Default for StorageUsageFlag {
4377 fn default() -> Self {
4378 Self::DEFAULT
4379 }
4380}
4381#[cfg_attr(feature = "ts", derive(TS))]
4382#[cfg_attr(feature = "ts", ts(export))]
4383#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4385#[cfg_attr(feature = "serde", serde(tag = "type"))]
4386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4387#[repr(u32)]
4388#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4389pub enum TuneFormat {
4390 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4391 TUNE_FORMAT_QBASIC1_1 = 1,
4392 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4393 TUNE_FORMAT_MML_MODERN = 2,
4394}
4395impl TuneFormat {
4396 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4397}
4398impl Default for TuneFormat {
4399 fn default() -> Self {
4400 Self::DEFAULT
4401 }
4402}
4403#[cfg_attr(feature = "ts", derive(TS))]
4404#[cfg_attr(feature = "ts", ts(export))]
4405#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4407#[cfg_attr(feature = "serde", serde(tag = "type"))]
4408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4409#[repr(u32)]
4410#[doc = "Available autopilot modes for ualberta uav"]
4411pub enum UalbertaAutopilotMode {
4412 #[doc = "Raw input pulse widts sent to output"]
4413 MODE_MANUAL_DIRECT = 1,
4414 #[doc = "Inputs are normalized using calibration, the converted back to raw pulse widths for output"]
4415 MODE_MANUAL_SCALED = 2,
4416 MODE_AUTO_PID_ATT = 3,
4417 MODE_AUTO_PID_VEL = 4,
4418 MODE_AUTO_PID_POS = 5,
4419}
4420impl UalbertaAutopilotMode {
4421 pub const DEFAULT: Self = Self::MODE_MANUAL_DIRECT;
4422}
4423impl Default for UalbertaAutopilotMode {
4424 fn default() -> Self {
4425 Self::DEFAULT
4426 }
4427}
4428#[cfg_attr(feature = "ts", derive(TS))]
4429#[cfg_attr(feature = "ts", ts(export))]
4430#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4431#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4432#[cfg_attr(feature = "serde", serde(tag = "type"))]
4433#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4434#[repr(u32)]
4435#[doc = "Navigation filter mode"]
4436pub enum UalbertaNavMode {
4437 NAV_AHRS_INIT = 1,
4438 #[doc = "AHRS mode"]
4439 NAV_AHRS = 2,
4440 #[doc = "INS/GPS initialization mode"]
4441 NAV_INS_GPS_INIT = 3,
4442 #[doc = "INS/GPS mode"]
4443 NAV_INS_GPS = 4,
4444}
4445impl UalbertaNavMode {
4446 pub const DEFAULT: Self = Self::NAV_AHRS_INIT;
4447}
4448impl Default for UalbertaNavMode {
4449 fn default() -> Self {
4450 Self::DEFAULT
4451 }
4452}
4453#[cfg_attr(feature = "ts", derive(TS))]
4454#[cfg_attr(feature = "ts", ts(export))]
4455#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4456#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4457#[cfg_attr(feature = "serde", serde(tag = "type"))]
4458#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4459#[repr(u32)]
4460#[doc = "Mode currently commanded by pilot"]
4461pub enum UalbertaPilotMode {
4462 PILOT_MANUAL = 1,
4463 PILOT_AUTO = 2,
4464 #[doc = "Rotomotion mode"]
4465 PILOT_ROTO = 3,
4466}
4467impl UalbertaPilotMode {
4468 pub const DEFAULT: Self = Self::PILOT_MANUAL;
4469}
4470impl Default for UalbertaPilotMode {
4471 fn default() -> Self {
4472 Self::DEFAULT
4473 }
4474}
4475#[cfg_attr(feature = "ts", derive(TS))]
4476#[cfg_attr(feature = "ts", ts(export))]
4477#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4479#[cfg_attr(feature = "serde", serde(tag = "type"))]
4480#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4481#[repr(u32)]
4482#[doc = "Generalized UAVCAN node health"]
4483pub enum UavcanNodeHealth {
4484 #[doc = "The node is functioning properly."]
4485 UAVCAN_NODE_HEALTH_OK = 0,
4486 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4487 UAVCAN_NODE_HEALTH_WARNING = 1,
4488 #[doc = "The node has encountered a major failure."]
4489 UAVCAN_NODE_HEALTH_ERROR = 2,
4490 #[doc = "The node has suffered a fatal malfunction."]
4491 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4492}
4493impl UavcanNodeHealth {
4494 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4495}
4496impl Default for UavcanNodeHealth {
4497 fn default() -> Self {
4498 Self::DEFAULT
4499 }
4500}
4501#[cfg_attr(feature = "ts", derive(TS))]
4502#[cfg_attr(feature = "ts", ts(export))]
4503#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4504#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4505#[cfg_attr(feature = "serde", serde(tag = "type"))]
4506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4507#[repr(u32)]
4508#[doc = "Generalized UAVCAN node mode"]
4509pub enum UavcanNodeMode {
4510 #[doc = "The node is performing its primary functions."]
4511 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4512 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4513 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4514 #[doc = "The node is under maintenance."]
4515 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4516 #[doc = "The node is in the process of updating its software."]
4517 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4518 #[doc = "The node is no longer available online."]
4519 UAVCAN_NODE_MODE_OFFLINE = 7,
4520}
4521impl UavcanNodeMode {
4522 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4523}
4524impl Default for UavcanNodeMode {
4525 fn default() -> Self {
4526 Self::DEFAULT
4527 }
4528}
4529bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4530impl UtmDataAvailFlags {
4531 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4532}
4533impl Default for UtmDataAvailFlags {
4534 fn default() -> Self {
4535 Self::DEFAULT
4536 }
4537}
4538#[cfg_attr(feature = "ts", derive(TS))]
4539#[cfg_attr(feature = "ts", ts(export))]
4540#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4541#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4542#[cfg_attr(feature = "serde", serde(tag = "type"))]
4543#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4544#[repr(u32)]
4545#[doc = "Airborne status of UAS."]
4546pub enum UtmFlightState {
4547 #[doc = "The flight state can't be determined."]
4548 UTM_FLIGHT_STATE_UNKNOWN = 1,
4549 #[doc = "UAS on ground."]
4550 UTM_FLIGHT_STATE_GROUND = 2,
4551 #[doc = "UAS airborne."]
4552 UTM_FLIGHT_STATE_AIRBORNE = 3,
4553 #[doc = "UAS is in an emergency flight state."]
4554 UTM_FLIGHT_STATE_EMERGENCY = 16,
4555 #[doc = "UAS has no active controls."]
4556 UTM_FLIGHT_STATE_NOCTRL = 32,
4557}
4558impl UtmFlightState {
4559 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4560}
4561impl Default for UtmFlightState {
4562 fn default() -> Self {
4563 Self::DEFAULT
4564 }
4565}
4566#[cfg_attr(feature = "ts", derive(TS))]
4567#[cfg_attr(feature = "ts", ts(export))]
4568#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4569#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4570#[cfg_attr(feature = "serde", serde(tag = "type"))]
4571#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4572#[repr(u32)]
4573#[doc = "Video stream encodings"]
4574pub enum VideoStreamEncoding {
4575 #[doc = "Stream encoding is unknown"]
4576 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4577 #[doc = "Stream encoding is H.264"]
4578 VIDEO_STREAM_ENCODING_H264 = 1,
4579 #[doc = "Stream encoding is H.265"]
4580 VIDEO_STREAM_ENCODING_H265 = 2,
4581}
4582impl VideoStreamEncoding {
4583 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4584}
4585impl Default for VideoStreamEncoding {
4586 fn default() -> Self {
4587 Self::DEFAULT
4588 }
4589}
4590bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4591impl VideoStreamStatusFlags {
4592 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4593}
4594impl Default for VideoStreamStatusFlags {
4595 fn default() -> Self {
4596 Self::DEFAULT
4597 }
4598}
4599#[cfg_attr(feature = "ts", derive(TS))]
4600#[cfg_attr(feature = "ts", ts(export))]
4601#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4602#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4603#[cfg_attr(feature = "serde", serde(tag = "type"))]
4604#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4605#[repr(u32)]
4606#[doc = "Video stream types"]
4607pub enum VideoStreamType {
4608 #[doc = "Stream is RTSP"]
4609 VIDEO_STREAM_TYPE_RTSP = 0,
4610 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4611 VIDEO_STREAM_TYPE_RTPUDP = 1,
4612 #[doc = "Stream is MPEG on TCP"]
4613 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4614 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4615 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4616}
4617impl VideoStreamType {
4618 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4619}
4620impl Default for VideoStreamType {
4621 fn default() -> Self {
4622 Self::DEFAULT
4623 }
4624}
4625#[cfg_attr(feature = "ts", derive(TS))]
4626#[cfg_attr(feature = "ts", ts(export))]
4627#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4628#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4629#[cfg_attr(feature = "serde", serde(tag = "type"))]
4630#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4631#[repr(u32)]
4632#[doc = "Direction of VTOL transition"]
4633pub enum VtolTransitionHeading {
4634 #[doc = "Respect the heading configuration of the vehicle."]
4635 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4636 #[doc = "Use the heading pointing towards the next waypoint."]
4637 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4638 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4639 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4640 #[doc = "Use the specified heading in parameter 4."]
4641 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4642 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4643 VTOL_TRANSITION_HEADING_ANY = 4,
4644}
4645impl VtolTransitionHeading {
4646 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4647}
4648impl Default for VtolTransitionHeading {
4649 fn default() -> Self {
4650 Self::DEFAULT
4651 }
4652}
4653#[cfg_attr(feature = "ts", derive(TS))]
4654#[cfg_attr(feature = "ts", ts(export))]
4655#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4656#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4657#[cfg_attr(feature = "serde", serde(tag = "type"))]
4658#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4659#[repr(u32)]
4660#[doc = "WiFi Mode."]
4661pub enum WifiConfigApMode {
4662 #[doc = "WiFi mode is undefined."]
4663 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4664 #[doc = "WiFi configured as an access point."]
4665 WIFI_CONFIG_AP_MODE_AP = 1,
4666 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4667 WIFI_CONFIG_AP_MODE_STATION = 2,
4668 #[doc = "WiFi disabled."]
4669 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4670}
4671impl WifiConfigApMode {
4672 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4673}
4674impl Default for WifiConfigApMode {
4675 fn default() -> Self {
4676 Self::DEFAULT
4677 }
4678}
4679#[cfg_attr(feature = "ts", derive(TS))]
4680#[cfg_attr(feature = "ts", ts(export))]
4681#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4682#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4683#[cfg_attr(feature = "serde", serde(tag = "type"))]
4684#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4685#[repr(u32)]
4686#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4687pub enum WifiConfigApResponse {
4688 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4689 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4690 #[doc = "Changes accepted."]
4691 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4692 #[doc = "Changes rejected."]
4693 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4694 #[doc = "Invalid Mode."]
4695 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4696 #[doc = "Invalid SSID."]
4697 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4698 #[doc = "Invalid Password."]
4699 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4700}
4701impl WifiConfigApResponse {
4702 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4703}
4704impl Default for WifiConfigApResponse {
4705 fn default() -> Self {
4706 Self::DEFAULT
4707 }
4708}
4709#[cfg_attr(feature = "ts", derive(TS))]
4710#[cfg_attr(feature = "ts", ts(export))]
4711#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4713#[cfg_attr(feature = "serde", serde(tag = "type"))]
4714#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4715#[repr(u32)]
4716#[doc = "Winch actions."]
4717pub enum WinchActions {
4718 #[doc = "Allow motor to freewheel."]
4719 WINCH_RELAXED = 0,
4720 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4721 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4722 #[doc = "Wind or unwind line at specified rate."]
4723 WINCH_RATE_CONTROL = 2,
4724 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4725 WINCH_LOCK = 3,
4726 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4727 WINCH_DELIVER = 4,
4728 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4729 WINCH_HOLD = 5,
4730 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4731 WINCH_RETRACT = 6,
4732 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4733 WINCH_LOAD_LINE = 7,
4734 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4735 WINCH_ABANDON_LINE = 8,
4736 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4737 WINCH_LOAD_PAYLOAD = 9,
4738}
4739impl WinchActions {
4740 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4741}
4742impl Default for WinchActions {
4743 fn default() -> Self {
4744 Self::DEFAULT
4745 }
4746}
4747#[doc = "Set the vehicle attitude and body angular rates."]
4748#[doc = ""]
4749#[doc = "ID: 140"]
4750#[derive(Debug, Clone, PartialEq)]
4751#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4752#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4753#[cfg_attr(feature = "ts", derive(TS))]
4754#[cfg_attr(feature = "ts", ts(export))]
4755pub struct ACTUATOR_CONTROL_TARGET_DATA {
4756 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4757 pub time_usec: u64,
4758 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4759 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4760 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4761 pub controls: [f32; 8],
4762 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4763 pub group_mlx: u8,
4764}
4765impl ACTUATOR_CONTROL_TARGET_DATA {
4766 pub const ENCODED_LEN: usize = 41usize;
4767 pub const DEFAULT: Self = Self {
4768 time_usec: 0_u64,
4769 controls: [0.0_f32; 8usize],
4770 group_mlx: 0_u8,
4771 };
4772 #[cfg(feature = "arbitrary")]
4773 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4774 use arbitrary::{Arbitrary, Unstructured};
4775 let mut buf = [0u8; 1024];
4776 rng.fill_bytes(&mut buf);
4777 let mut unstructured = Unstructured::new(&buf);
4778 Self::arbitrary(&mut unstructured).unwrap_or_default()
4779 }
4780}
4781impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4782 fn default() -> Self {
4783 Self::DEFAULT.clone()
4784 }
4785}
4786impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4787 type Message = MavMessage;
4788 const ID: u32 = 140u32;
4789 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4790 const EXTRA_CRC: u8 = 181u8;
4791 const ENCODED_LEN: usize = 41usize;
4792 fn deser(
4793 _version: MavlinkVersion,
4794 __input: &[u8],
4795 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4796 let avail_len = __input.len();
4797 let mut payload_buf = [0; Self::ENCODED_LEN];
4798 let mut buf = if avail_len < Self::ENCODED_LEN {
4799 payload_buf[0..avail_len].copy_from_slice(__input);
4800 Bytes::new(&payload_buf)
4801 } else {
4802 Bytes::new(__input)
4803 };
4804 let mut __struct = Self::default();
4805 __struct.time_usec = buf.get_u64_le();
4806 for v in &mut __struct.controls {
4807 let val = buf.get_f32_le();
4808 *v = val;
4809 }
4810 __struct.group_mlx = buf.get_u8();
4811 Ok(__struct)
4812 }
4813 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4814 let mut __tmp = BytesMut::new(bytes);
4815 #[allow(clippy::absurd_extreme_comparisons)]
4816 #[allow(unused_comparisons)]
4817 if __tmp.remaining() < Self::ENCODED_LEN {
4818 panic!(
4819 "buffer is too small (need {} bytes, but got {})",
4820 Self::ENCODED_LEN,
4821 __tmp.remaining(),
4822 )
4823 }
4824 __tmp.put_u64_le(self.time_usec);
4825 for val in &self.controls {
4826 __tmp.put_f32_le(*val);
4827 }
4828 __tmp.put_u8(self.group_mlx);
4829 if matches!(version, MavlinkVersion::V2) {
4830 let len = __tmp.len();
4831 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4832 } else {
4833 __tmp.len()
4834 }
4835 }
4836}
4837#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4838#[doc = ""]
4839#[doc = "ID: 375"]
4840#[derive(Debug, Clone, PartialEq)]
4841#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4842#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4843#[cfg_attr(feature = "ts", derive(TS))]
4844#[cfg_attr(feature = "ts", ts(export))]
4845pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4846 #[doc = "Timestamp (since system boot)."]
4847 pub time_usec: u64,
4848 #[doc = "Active outputs"]
4849 pub active: u32,
4850 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4851 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4852 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4853 pub actuator: [f32; 32],
4854}
4855impl ACTUATOR_OUTPUT_STATUS_DATA {
4856 pub const ENCODED_LEN: usize = 140usize;
4857 pub const DEFAULT: Self = Self {
4858 time_usec: 0_u64,
4859 active: 0_u32,
4860 actuator: [0.0_f32; 32usize],
4861 };
4862 #[cfg(feature = "arbitrary")]
4863 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4864 use arbitrary::{Arbitrary, Unstructured};
4865 let mut buf = [0u8; 1024];
4866 rng.fill_bytes(&mut buf);
4867 let mut unstructured = Unstructured::new(&buf);
4868 Self::arbitrary(&mut unstructured).unwrap_or_default()
4869 }
4870}
4871impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4872 fn default() -> Self {
4873 Self::DEFAULT.clone()
4874 }
4875}
4876impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4877 type Message = MavMessage;
4878 const ID: u32 = 375u32;
4879 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4880 const EXTRA_CRC: u8 = 251u8;
4881 const ENCODED_LEN: usize = 140usize;
4882 fn deser(
4883 _version: MavlinkVersion,
4884 __input: &[u8],
4885 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4886 let avail_len = __input.len();
4887 let mut payload_buf = [0; Self::ENCODED_LEN];
4888 let mut buf = if avail_len < Self::ENCODED_LEN {
4889 payload_buf[0..avail_len].copy_from_slice(__input);
4890 Bytes::new(&payload_buf)
4891 } else {
4892 Bytes::new(__input)
4893 };
4894 let mut __struct = Self::default();
4895 __struct.time_usec = buf.get_u64_le();
4896 __struct.active = buf.get_u32_le();
4897 for v in &mut __struct.actuator {
4898 let val = buf.get_f32_le();
4899 *v = val;
4900 }
4901 Ok(__struct)
4902 }
4903 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4904 let mut __tmp = BytesMut::new(bytes);
4905 #[allow(clippy::absurd_extreme_comparisons)]
4906 #[allow(unused_comparisons)]
4907 if __tmp.remaining() < Self::ENCODED_LEN {
4908 panic!(
4909 "buffer is too small (need {} bytes, but got {})",
4910 Self::ENCODED_LEN,
4911 __tmp.remaining(),
4912 )
4913 }
4914 __tmp.put_u64_le(self.time_usec);
4915 __tmp.put_u32_le(self.active);
4916 for val in &self.actuator {
4917 __tmp.put_f32_le(*val);
4918 }
4919 if matches!(version, MavlinkVersion::V2) {
4920 let len = __tmp.len();
4921 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4922 } else {
4923 __tmp.len()
4924 }
4925 }
4926}
4927#[doc = "The location and information of an ADSB vehicle."]
4928#[doc = ""]
4929#[doc = "ID: 246"]
4930#[derive(Debug, Clone, PartialEq)]
4931#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4933#[cfg_attr(feature = "ts", derive(TS))]
4934#[cfg_attr(feature = "ts", ts(export))]
4935pub struct ADSB_VEHICLE_DATA {
4936 #[doc = "ICAO address"]
4937 pub ICAO_address: u32,
4938 #[doc = "Latitude"]
4939 pub lat: i32,
4940 #[doc = "Longitude"]
4941 pub lon: i32,
4942 #[doc = "Altitude(ASL)"]
4943 pub altitude: i32,
4944 #[doc = "Course over ground"]
4945 pub heading: u16,
4946 #[doc = "The horizontal velocity"]
4947 pub hor_velocity: u16,
4948 #[doc = "The vertical velocity. Positive is up"]
4949 pub ver_velocity: i16,
4950 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4951 pub flags: AdsbFlags,
4952 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4953 pub squawk: u16,
4954 #[doc = "ADSB altitude type."]
4955 pub altitude_type: AdsbAltitudeType,
4956 #[doc = "The callsign, 8+null"]
4957 #[cfg_attr(feature = "ts", ts(type = "string"))]
4958 pub callsign: CharArray<9>,
4959 #[doc = "ADSB emitter type."]
4960 pub emitter_type: AdsbEmitterType,
4961 #[doc = "Time since last communication in seconds"]
4962 pub tslc: u8,
4963}
4964impl ADSB_VEHICLE_DATA {
4965 pub const ENCODED_LEN: usize = 38usize;
4966 pub const DEFAULT: Self = Self {
4967 ICAO_address: 0_u32,
4968 lat: 0_i32,
4969 lon: 0_i32,
4970 altitude: 0_i32,
4971 heading: 0_u16,
4972 hor_velocity: 0_u16,
4973 ver_velocity: 0_i16,
4974 flags: AdsbFlags::DEFAULT,
4975 squawk: 0_u16,
4976 altitude_type: AdsbAltitudeType::DEFAULT,
4977 callsign: CharArray::new([0_u8; 9usize]),
4978 emitter_type: AdsbEmitterType::DEFAULT,
4979 tslc: 0_u8,
4980 };
4981 #[cfg(feature = "arbitrary")]
4982 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4983 use arbitrary::{Arbitrary, Unstructured};
4984 let mut buf = [0u8; 1024];
4985 rng.fill_bytes(&mut buf);
4986 let mut unstructured = Unstructured::new(&buf);
4987 Self::arbitrary(&mut unstructured).unwrap_or_default()
4988 }
4989}
4990impl Default for ADSB_VEHICLE_DATA {
4991 fn default() -> Self {
4992 Self::DEFAULT.clone()
4993 }
4994}
4995impl MessageData for ADSB_VEHICLE_DATA {
4996 type Message = MavMessage;
4997 const ID: u32 = 246u32;
4998 const NAME: &'static str = "ADSB_VEHICLE";
4999 const EXTRA_CRC: u8 = 184u8;
5000 const ENCODED_LEN: usize = 38usize;
5001 fn deser(
5002 _version: MavlinkVersion,
5003 __input: &[u8],
5004 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5005 let avail_len = __input.len();
5006 let mut payload_buf = [0; Self::ENCODED_LEN];
5007 let mut buf = if avail_len < Self::ENCODED_LEN {
5008 payload_buf[0..avail_len].copy_from_slice(__input);
5009 Bytes::new(&payload_buf)
5010 } else {
5011 Bytes::new(__input)
5012 };
5013 let mut __struct = Self::default();
5014 __struct.ICAO_address = buf.get_u32_le();
5015 __struct.lat = buf.get_i32_le();
5016 __struct.lon = buf.get_i32_le();
5017 __struct.altitude = buf.get_i32_le();
5018 __struct.heading = buf.get_u16_le();
5019 __struct.hor_velocity = buf.get_u16_le();
5020 __struct.ver_velocity = buf.get_i16_le();
5021 let tmp = buf.get_u16_le();
5022 __struct.flags = AdsbFlags::from_bits(tmp as <AdsbFlags as Flags>::Bits).ok_or(
5023 ::mavlink_core::error::ParserError::InvalidFlag {
5024 flag_type: "AdsbFlags",
5025 value: tmp as u64,
5026 },
5027 )?;
5028 __struct.squawk = buf.get_u16_le();
5029 let tmp = buf.get_u8();
5030 __struct.altitude_type =
5031 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5032 enum_type: "AdsbAltitudeType",
5033 value: tmp as u64,
5034 })?;
5035 let mut tmp = [0_u8; 9usize];
5036 for v in &mut tmp {
5037 *v = buf.get_u8();
5038 }
5039 __struct.callsign = CharArray::new(tmp);
5040 let tmp = buf.get_u8();
5041 __struct.emitter_type =
5042 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5043 enum_type: "AdsbEmitterType",
5044 value: tmp as u64,
5045 })?;
5046 __struct.tslc = buf.get_u8();
5047 Ok(__struct)
5048 }
5049 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5050 let mut __tmp = BytesMut::new(bytes);
5051 #[allow(clippy::absurd_extreme_comparisons)]
5052 #[allow(unused_comparisons)]
5053 if __tmp.remaining() < Self::ENCODED_LEN {
5054 panic!(
5055 "buffer is too small (need {} bytes, but got {})",
5056 Self::ENCODED_LEN,
5057 __tmp.remaining(),
5058 )
5059 }
5060 __tmp.put_u32_le(self.ICAO_address);
5061 __tmp.put_i32_le(self.lat);
5062 __tmp.put_i32_le(self.lon);
5063 __tmp.put_i32_le(self.altitude);
5064 __tmp.put_u16_le(self.heading);
5065 __tmp.put_u16_le(self.hor_velocity);
5066 __tmp.put_i16_le(self.ver_velocity);
5067 __tmp.put_u16_le(self.flags.bits() as u16);
5068 __tmp.put_u16_le(self.squawk);
5069 __tmp.put_u8(self.altitude_type as u8);
5070 for val in &self.callsign {
5071 __tmp.put_u8(*val);
5072 }
5073 __tmp.put_u8(self.emitter_type as u8);
5074 __tmp.put_u8(self.tslc);
5075 if matches!(version, MavlinkVersion::V2) {
5076 let len = __tmp.len();
5077 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5078 } else {
5079 __tmp.len()
5080 }
5081 }
5082}
5083#[doc = "The location and information of an AIS vessel."]
5084#[doc = ""]
5085#[doc = "ID: 301"]
5086#[derive(Debug, Clone, PartialEq)]
5087#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5089#[cfg_attr(feature = "ts", derive(TS))]
5090#[cfg_attr(feature = "ts", ts(export))]
5091pub struct AIS_VESSEL_DATA {
5092 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5093 pub MMSI: u32,
5094 #[doc = "Latitude"]
5095 pub lat: i32,
5096 #[doc = "Longitude"]
5097 pub lon: i32,
5098 #[doc = "Course over ground"]
5099 pub COG: u16,
5100 #[doc = "True heading"]
5101 pub heading: u16,
5102 #[doc = "Speed over ground"]
5103 pub velocity: u16,
5104 #[doc = "Distance from lat/lon location to bow"]
5105 pub dimension_bow: u16,
5106 #[doc = "Distance from lat/lon location to stern"]
5107 pub dimension_stern: u16,
5108 #[doc = "Time since last communication in seconds"]
5109 pub tslc: u16,
5110 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5111 pub flags: AisFlags,
5112 #[doc = "Turn rate"]
5113 pub turn_rate: i8,
5114 #[doc = "Navigational status"]
5115 pub navigational_status: AisNavStatus,
5116 #[doc = "Type of vessels"]
5117 pub mavtype: AisType,
5118 #[doc = "Distance from lat/lon location to port side"]
5119 pub dimension_port: u8,
5120 #[doc = "Distance from lat/lon location to starboard side"]
5121 pub dimension_starboard: u8,
5122 #[doc = "The vessel callsign"]
5123 #[cfg_attr(feature = "ts", ts(type = "string"))]
5124 pub callsign: CharArray<7>,
5125 #[doc = "The vessel name"]
5126 #[cfg_attr(feature = "ts", ts(type = "string"))]
5127 pub name: CharArray<20>,
5128}
5129impl AIS_VESSEL_DATA {
5130 pub const ENCODED_LEN: usize = 58usize;
5131 pub const DEFAULT: Self = Self {
5132 MMSI: 0_u32,
5133 lat: 0_i32,
5134 lon: 0_i32,
5135 COG: 0_u16,
5136 heading: 0_u16,
5137 velocity: 0_u16,
5138 dimension_bow: 0_u16,
5139 dimension_stern: 0_u16,
5140 tslc: 0_u16,
5141 flags: AisFlags::DEFAULT,
5142 turn_rate: 0_i8,
5143 navigational_status: AisNavStatus::DEFAULT,
5144 mavtype: AisType::DEFAULT,
5145 dimension_port: 0_u8,
5146 dimension_starboard: 0_u8,
5147 callsign: CharArray::new([0_u8; 7usize]),
5148 name: CharArray::new([0_u8; 20usize]),
5149 };
5150 #[cfg(feature = "arbitrary")]
5151 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5152 use arbitrary::{Arbitrary, Unstructured};
5153 let mut buf = [0u8; 1024];
5154 rng.fill_bytes(&mut buf);
5155 let mut unstructured = Unstructured::new(&buf);
5156 Self::arbitrary(&mut unstructured).unwrap_or_default()
5157 }
5158}
5159impl Default for AIS_VESSEL_DATA {
5160 fn default() -> Self {
5161 Self::DEFAULT.clone()
5162 }
5163}
5164impl MessageData for AIS_VESSEL_DATA {
5165 type Message = MavMessage;
5166 const ID: u32 = 301u32;
5167 const NAME: &'static str = "AIS_VESSEL";
5168 const EXTRA_CRC: u8 = 243u8;
5169 const ENCODED_LEN: usize = 58usize;
5170 fn deser(
5171 _version: MavlinkVersion,
5172 __input: &[u8],
5173 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5174 let avail_len = __input.len();
5175 let mut payload_buf = [0; Self::ENCODED_LEN];
5176 let mut buf = if avail_len < Self::ENCODED_LEN {
5177 payload_buf[0..avail_len].copy_from_slice(__input);
5178 Bytes::new(&payload_buf)
5179 } else {
5180 Bytes::new(__input)
5181 };
5182 let mut __struct = Self::default();
5183 __struct.MMSI = buf.get_u32_le();
5184 __struct.lat = buf.get_i32_le();
5185 __struct.lon = buf.get_i32_le();
5186 __struct.COG = buf.get_u16_le();
5187 __struct.heading = buf.get_u16_le();
5188 __struct.velocity = buf.get_u16_le();
5189 __struct.dimension_bow = buf.get_u16_le();
5190 __struct.dimension_stern = buf.get_u16_le();
5191 __struct.tslc = buf.get_u16_le();
5192 let tmp = buf.get_u16_le();
5193 __struct.flags = AisFlags::from_bits(tmp as <AisFlags as Flags>::Bits).ok_or(
5194 ::mavlink_core::error::ParserError::InvalidFlag {
5195 flag_type: "AisFlags",
5196 value: tmp as u64,
5197 },
5198 )?;
5199 __struct.turn_rate = buf.get_i8();
5200 let tmp = buf.get_u8();
5201 __struct.navigational_status =
5202 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5203 enum_type: "AisNavStatus",
5204 value: tmp as u64,
5205 })?;
5206 let tmp = buf.get_u8();
5207 __struct.mavtype =
5208 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5209 enum_type: "AisType",
5210 value: tmp as u64,
5211 })?;
5212 __struct.dimension_port = buf.get_u8();
5213 __struct.dimension_starboard = buf.get_u8();
5214 let mut tmp = [0_u8; 7usize];
5215 for v in &mut tmp {
5216 *v = buf.get_u8();
5217 }
5218 __struct.callsign = CharArray::new(tmp);
5219 let mut tmp = [0_u8; 20usize];
5220 for v in &mut tmp {
5221 *v = buf.get_u8();
5222 }
5223 __struct.name = CharArray::new(tmp);
5224 Ok(__struct)
5225 }
5226 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5227 let mut __tmp = BytesMut::new(bytes);
5228 #[allow(clippy::absurd_extreme_comparisons)]
5229 #[allow(unused_comparisons)]
5230 if __tmp.remaining() < Self::ENCODED_LEN {
5231 panic!(
5232 "buffer is too small (need {} bytes, but got {})",
5233 Self::ENCODED_LEN,
5234 __tmp.remaining(),
5235 )
5236 }
5237 __tmp.put_u32_le(self.MMSI);
5238 __tmp.put_i32_le(self.lat);
5239 __tmp.put_i32_le(self.lon);
5240 __tmp.put_u16_le(self.COG);
5241 __tmp.put_u16_le(self.heading);
5242 __tmp.put_u16_le(self.velocity);
5243 __tmp.put_u16_le(self.dimension_bow);
5244 __tmp.put_u16_le(self.dimension_stern);
5245 __tmp.put_u16_le(self.tslc);
5246 __tmp.put_u16_le(self.flags.bits() as u16);
5247 __tmp.put_i8(self.turn_rate);
5248 __tmp.put_u8(self.navigational_status as u8);
5249 __tmp.put_u8(self.mavtype as u8);
5250 __tmp.put_u8(self.dimension_port);
5251 __tmp.put_u8(self.dimension_starboard);
5252 for val in &self.callsign {
5253 __tmp.put_u8(*val);
5254 }
5255 for val in &self.name {
5256 __tmp.put_u8(*val);
5257 }
5258 if matches!(version, MavlinkVersion::V2) {
5259 let len = __tmp.len();
5260 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5261 } else {
5262 __tmp.len()
5263 }
5264 }
5265}
5266#[doc = "The current system altitude."]
5267#[doc = ""]
5268#[doc = "ID: 141"]
5269#[derive(Debug, Clone, PartialEq)]
5270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5272#[cfg_attr(feature = "ts", derive(TS))]
5273#[cfg_attr(feature = "ts", ts(export))]
5274pub struct ALTITUDE_DATA {
5275 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5276 pub time_usec: u64,
5277 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5278 pub altitude_monotonic: f32,
5279 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5280 pub altitude_amsl: f32,
5281 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5282 pub altitude_local: f32,
5283 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5284 pub altitude_relative: f32,
5285 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5286 pub altitude_terrain: f32,
5287 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5288 pub bottom_clearance: f32,
5289}
5290impl ALTITUDE_DATA {
5291 pub const ENCODED_LEN: usize = 32usize;
5292 pub const DEFAULT: Self = Self {
5293 time_usec: 0_u64,
5294 altitude_monotonic: 0.0_f32,
5295 altitude_amsl: 0.0_f32,
5296 altitude_local: 0.0_f32,
5297 altitude_relative: 0.0_f32,
5298 altitude_terrain: 0.0_f32,
5299 bottom_clearance: 0.0_f32,
5300 };
5301 #[cfg(feature = "arbitrary")]
5302 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5303 use arbitrary::{Arbitrary, Unstructured};
5304 let mut buf = [0u8; 1024];
5305 rng.fill_bytes(&mut buf);
5306 let mut unstructured = Unstructured::new(&buf);
5307 Self::arbitrary(&mut unstructured).unwrap_or_default()
5308 }
5309}
5310impl Default for ALTITUDE_DATA {
5311 fn default() -> Self {
5312 Self::DEFAULT.clone()
5313 }
5314}
5315impl MessageData for ALTITUDE_DATA {
5316 type Message = MavMessage;
5317 const ID: u32 = 141u32;
5318 const NAME: &'static str = "ALTITUDE";
5319 const EXTRA_CRC: u8 = 47u8;
5320 const ENCODED_LEN: usize = 32usize;
5321 fn deser(
5322 _version: MavlinkVersion,
5323 __input: &[u8],
5324 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5325 let avail_len = __input.len();
5326 let mut payload_buf = [0; Self::ENCODED_LEN];
5327 let mut buf = if avail_len < Self::ENCODED_LEN {
5328 payload_buf[0..avail_len].copy_from_slice(__input);
5329 Bytes::new(&payload_buf)
5330 } else {
5331 Bytes::new(__input)
5332 };
5333 let mut __struct = Self::default();
5334 __struct.time_usec = buf.get_u64_le();
5335 __struct.altitude_monotonic = buf.get_f32_le();
5336 __struct.altitude_amsl = buf.get_f32_le();
5337 __struct.altitude_local = buf.get_f32_le();
5338 __struct.altitude_relative = buf.get_f32_le();
5339 __struct.altitude_terrain = buf.get_f32_le();
5340 __struct.bottom_clearance = buf.get_f32_le();
5341 Ok(__struct)
5342 }
5343 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5344 let mut __tmp = BytesMut::new(bytes);
5345 #[allow(clippy::absurd_extreme_comparisons)]
5346 #[allow(unused_comparisons)]
5347 if __tmp.remaining() < Self::ENCODED_LEN {
5348 panic!(
5349 "buffer is too small (need {} bytes, but got {})",
5350 Self::ENCODED_LEN,
5351 __tmp.remaining(),
5352 )
5353 }
5354 __tmp.put_u64_le(self.time_usec);
5355 __tmp.put_f32_le(self.altitude_monotonic);
5356 __tmp.put_f32_le(self.altitude_amsl);
5357 __tmp.put_f32_le(self.altitude_local);
5358 __tmp.put_f32_le(self.altitude_relative);
5359 __tmp.put_f32_le(self.altitude_terrain);
5360 __tmp.put_f32_le(self.bottom_clearance);
5361 if matches!(version, MavlinkVersion::V2) {
5362 let len = __tmp.len();
5363 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5364 } else {
5365 __tmp.len()
5366 }
5367 }
5368}
5369#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5370#[doc = ""]
5371#[doc = "ID: 30"]
5372#[derive(Debug, Clone, PartialEq)]
5373#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5374#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5375#[cfg_attr(feature = "ts", derive(TS))]
5376#[cfg_attr(feature = "ts", ts(export))]
5377pub struct ATTITUDE_DATA {
5378 #[doc = "Timestamp (time since system boot)."]
5379 pub time_boot_ms: u32,
5380 #[doc = "Roll angle (-pi..+pi)"]
5381 pub roll: f32,
5382 #[doc = "Pitch angle (-pi..+pi)"]
5383 pub pitch: f32,
5384 #[doc = "Yaw angle (-pi..+pi)"]
5385 pub yaw: f32,
5386 #[doc = "Roll angular speed"]
5387 pub rollspeed: f32,
5388 #[doc = "Pitch angular speed"]
5389 pub pitchspeed: f32,
5390 #[doc = "Yaw angular speed"]
5391 pub yawspeed: f32,
5392}
5393impl ATTITUDE_DATA {
5394 pub const ENCODED_LEN: usize = 28usize;
5395 pub const DEFAULT: Self = Self {
5396 time_boot_ms: 0_u32,
5397 roll: 0.0_f32,
5398 pitch: 0.0_f32,
5399 yaw: 0.0_f32,
5400 rollspeed: 0.0_f32,
5401 pitchspeed: 0.0_f32,
5402 yawspeed: 0.0_f32,
5403 };
5404 #[cfg(feature = "arbitrary")]
5405 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5406 use arbitrary::{Arbitrary, Unstructured};
5407 let mut buf = [0u8; 1024];
5408 rng.fill_bytes(&mut buf);
5409 let mut unstructured = Unstructured::new(&buf);
5410 Self::arbitrary(&mut unstructured).unwrap_or_default()
5411 }
5412}
5413impl Default for ATTITUDE_DATA {
5414 fn default() -> Self {
5415 Self::DEFAULT.clone()
5416 }
5417}
5418impl MessageData for ATTITUDE_DATA {
5419 type Message = MavMessage;
5420 const ID: u32 = 30u32;
5421 const NAME: &'static str = "ATTITUDE";
5422 const EXTRA_CRC: u8 = 39u8;
5423 const ENCODED_LEN: usize = 28usize;
5424 fn deser(
5425 _version: MavlinkVersion,
5426 __input: &[u8],
5427 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5428 let avail_len = __input.len();
5429 let mut payload_buf = [0; Self::ENCODED_LEN];
5430 let mut buf = if avail_len < Self::ENCODED_LEN {
5431 payload_buf[0..avail_len].copy_from_slice(__input);
5432 Bytes::new(&payload_buf)
5433 } else {
5434 Bytes::new(__input)
5435 };
5436 let mut __struct = Self::default();
5437 __struct.time_boot_ms = buf.get_u32_le();
5438 __struct.roll = buf.get_f32_le();
5439 __struct.pitch = buf.get_f32_le();
5440 __struct.yaw = buf.get_f32_le();
5441 __struct.rollspeed = buf.get_f32_le();
5442 __struct.pitchspeed = buf.get_f32_le();
5443 __struct.yawspeed = buf.get_f32_le();
5444 Ok(__struct)
5445 }
5446 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5447 let mut __tmp = BytesMut::new(bytes);
5448 #[allow(clippy::absurd_extreme_comparisons)]
5449 #[allow(unused_comparisons)]
5450 if __tmp.remaining() < Self::ENCODED_LEN {
5451 panic!(
5452 "buffer is too small (need {} bytes, but got {})",
5453 Self::ENCODED_LEN,
5454 __tmp.remaining(),
5455 )
5456 }
5457 __tmp.put_u32_le(self.time_boot_ms);
5458 __tmp.put_f32_le(self.roll);
5459 __tmp.put_f32_le(self.pitch);
5460 __tmp.put_f32_le(self.yaw);
5461 __tmp.put_f32_le(self.rollspeed);
5462 __tmp.put_f32_le(self.pitchspeed);
5463 __tmp.put_f32_le(self.yawspeed);
5464 if matches!(version, MavlinkVersion::V2) {
5465 let len = __tmp.len();
5466 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5467 } else {
5468 __tmp.len()
5469 }
5470 }
5471}
5472#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5473#[doc = ""]
5474#[doc = "ID: 31"]
5475#[derive(Debug, Clone, PartialEq)]
5476#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5477#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5478#[cfg_attr(feature = "ts", derive(TS))]
5479#[cfg_attr(feature = "ts", ts(export))]
5480pub struct ATTITUDE_QUATERNION_DATA {
5481 #[doc = "Timestamp (time since system boot)."]
5482 pub time_boot_ms: u32,
5483 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5484 pub q1: f32,
5485 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5486 pub q2: f32,
5487 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5488 pub q3: f32,
5489 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5490 pub q4: f32,
5491 #[doc = "Roll angular speed"]
5492 pub rollspeed: f32,
5493 #[doc = "Pitch angular speed"]
5494 pub pitchspeed: f32,
5495 #[doc = "Yaw angular speed"]
5496 pub yawspeed: f32,
5497 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5498 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5499 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5500 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5501 pub repr_offset_q: [f32; 4],
5502}
5503impl ATTITUDE_QUATERNION_DATA {
5504 pub const ENCODED_LEN: usize = 48usize;
5505 pub const DEFAULT: Self = Self {
5506 time_boot_ms: 0_u32,
5507 q1: 0.0_f32,
5508 q2: 0.0_f32,
5509 q3: 0.0_f32,
5510 q4: 0.0_f32,
5511 rollspeed: 0.0_f32,
5512 pitchspeed: 0.0_f32,
5513 yawspeed: 0.0_f32,
5514 repr_offset_q: [0.0_f32; 4usize],
5515 };
5516 #[cfg(feature = "arbitrary")]
5517 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5518 use arbitrary::{Arbitrary, Unstructured};
5519 let mut buf = [0u8; 1024];
5520 rng.fill_bytes(&mut buf);
5521 let mut unstructured = Unstructured::new(&buf);
5522 Self::arbitrary(&mut unstructured).unwrap_or_default()
5523 }
5524}
5525impl Default for ATTITUDE_QUATERNION_DATA {
5526 fn default() -> Self {
5527 Self::DEFAULT.clone()
5528 }
5529}
5530impl MessageData for ATTITUDE_QUATERNION_DATA {
5531 type Message = MavMessage;
5532 const ID: u32 = 31u32;
5533 const NAME: &'static str = "ATTITUDE_QUATERNION";
5534 const EXTRA_CRC: u8 = 246u8;
5535 const ENCODED_LEN: usize = 48usize;
5536 fn deser(
5537 _version: MavlinkVersion,
5538 __input: &[u8],
5539 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5540 let avail_len = __input.len();
5541 let mut payload_buf = [0; Self::ENCODED_LEN];
5542 let mut buf = if avail_len < Self::ENCODED_LEN {
5543 payload_buf[0..avail_len].copy_from_slice(__input);
5544 Bytes::new(&payload_buf)
5545 } else {
5546 Bytes::new(__input)
5547 };
5548 let mut __struct = Self::default();
5549 __struct.time_boot_ms = buf.get_u32_le();
5550 __struct.q1 = buf.get_f32_le();
5551 __struct.q2 = buf.get_f32_le();
5552 __struct.q3 = buf.get_f32_le();
5553 __struct.q4 = buf.get_f32_le();
5554 __struct.rollspeed = buf.get_f32_le();
5555 __struct.pitchspeed = buf.get_f32_le();
5556 __struct.yawspeed = buf.get_f32_le();
5557 for v in &mut __struct.repr_offset_q {
5558 let val = buf.get_f32_le();
5559 *v = val;
5560 }
5561 Ok(__struct)
5562 }
5563 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5564 let mut __tmp = BytesMut::new(bytes);
5565 #[allow(clippy::absurd_extreme_comparisons)]
5566 #[allow(unused_comparisons)]
5567 if __tmp.remaining() < Self::ENCODED_LEN {
5568 panic!(
5569 "buffer is too small (need {} bytes, but got {})",
5570 Self::ENCODED_LEN,
5571 __tmp.remaining(),
5572 )
5573 }
5574 __tmp.put_u32_le(self.time_boot_ms);
5575 __tmp.put_f32_le(self.q1);
5576 __tmp.put_f32_le(self.q2);
5577 __tmp.put_f32_le(self.q3);
5578 __tmp.put_f32_le(self.q4);
5579 __tmp.put_f32_le(self.rollspeed);
5580 __tmp.put_f32_le(self.pitchspeed);
5581 __tmp.put_f32_le(self.yawspeed);
5582 if matches!(version, MavlinkVersion::V2) {
5583 for val in &self.repr_offset_q {
5584 __tmp.put_f32_le(*val);
5585 }
5586 let len = __tmp.len();
5587 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5588 } else {
5589 __tmp.len()
5590 }
5591 }
5592}
5593#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5594#[doc = ""]
5595#[doc = "ID: 61"]
5596#[derive(Debug, Clone, PartialEq)]
5597#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5599#[cfg_attr(feature = "ts", derive(TS))]
5600#[cfg_attr(feature = "ts", ts(export))]
5601pub struct ATTITUDE_QUATERNION_COV_DATA {
5602 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5603 pub time_usec: u64,
5604 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5605 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5606 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5607 pub q: [f32; 4],
5608 #[doc = "Roll angular speed"]
5609 pub rollspeed: f32,
5610 #[doc = "Pitch angular speed"]
5611 pub pitchspeed: f32,
5612 #[doc = "Yaw angular speed"]
5613 pub yawspeed: f32,
5614 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5615 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5616 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5617 pub covariance: [f32; 9],
5618}
5619impl ATTITUDE_QUATERNION_COV_DATA {
5620 pub const ENCODED_LEN: usize = 72usize;
5621 pub const DEFAULT: Self = Self {
5622 time_usec: 0_u64,
5623 q: [0.0_f32; 4usize],
5624 rollspeed: 0.0_f32,
5625 pitchspeed: 0.0_f32,
5626 yawspeed: 0.0_f32,
5627 covariance: [0.0_f32; 9usize],
5628 };
5629 #[cfg(feature = "arbitrary")]
5630 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5631 use arbitrary::{Arbitrary, Unstructured};
5632 let mut buf = [0u8; 1024];
5633 rng.fill_bytes(&mut buf);
5634 let mut unstructured = Unstructured::new(&buf);
5635 Self::arbitrary(&mut unstructured).unwrap_or_default()
5636 }
5637}
5638impl Default for ATTITUDE_QUATERNION_COV_DATA {
5639 fn default() -> Self {
5640 Self::DEFAULT.clone()
5641 }
5642}
5643impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5644 type Message = MavMessage;
5645 const ID: u32 = 61u32;
5646 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5647 const EXTRA_CRC: u8 = 167u8;
5648 const ENCODED_LEN: usize = 72usize;
5649 fn deser(
5650 _version: MavlinkVersion,
5651 __input: &[u8],
5652 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5653 let avail_len = __input.len();
5654 let mut payload_buf = [0; Self::ENCODED_LEN];
5655 let mut buf = if avail_len < Self::ENCODED_LEN {
5656 payload_buf[0..avail_len].copy_from_slice(__input);
5657 Bytes::new(&payload_buf)
5658 } else {
5659 Bytes::new(__input)
5660 };
5661 let mut __struct = Self::default();
5662 __struct.time_usec = buf.get_u64_le();
5663 for v in &mut __struct.q {
5664 let val = buf.get_f32_le();
5665 *v = val;
5666 }
5667 __struct.rollspeed = buf.get_f32_le();
5668 __struct.pitchspeed = buf.get_f32_le();
5669 __struct.yawspeed = buf.get_f32_le();
5670 for v in &mut __struct.covariance {
5671 let val = buf.get_f32_le();
5672 *v = val;
5673 }
5674 Ok(__struct)
5675 }
5676 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5677 let mut __tmp = BytesMut::new(bytes);
5678 #[allow(clippy::absurd_extreme_comparisons)]
5679 #[allow(unused_comparisons)]
5680 if __tmp.remaining() < Self::ENCODED_LEN {
5681 panic!(
5682 "buffer is too small (need {} bytes, but got {})",
5683 Self::ENCODED_LEN,
5684 __tmp.remaining(),
5685 )
5686 }
5687 __tmp.put_u64_le(self.time_usec);
5688 for val in &self.q {
5689 __tmp.put_f32_le(*val);
5690 }
5691 __tmp.put_f32_le(self.rollspeed);
5692 __tmp.put_f32_le(self.pitchspeed);
5693 __tmp.put_f32_le(self.yawspeed);
5694 for val in &self.covariance {
5695 __tmp.put_f32_le(*val);
5696 }
5697 if matches!(version, MavlinkVersion::V2) {
5698 let len = __tmp.len();
5699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5700 } else {
5701 __tmp.len()
5702 }
5703 }
5704}
5705#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5706#[doc = ""]
5707#[doc = "ID: 83"]
5708#[derive(Debug, Clone, PartialEq)]
5709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5710#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5711#[cfg_attr(feature = "ts", derive(TS))]
5712#[cfg_attr(feature = "ts", ts(export))]
5713pub struct ATTITUDE_TARGET_DATA {
5714 #[doc = "Timestamp (time since system boot)."]
5715 pub time_boot_ms: u32,
5716 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5717 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5718 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5719 pub q: [f32; 4],
5720 #[doc = "Body roll rate"]
5721 pub body_roll_rate: f32,
5722 #[doc = "Body pitch rate"]
5723 pub body_pitch_rate: f32,
5724 #[doc = "Body yaw rate"]
5725 pub body_yaw_rate: f32,
5726 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5727 pub thrust: f32,
5728 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5729 pub type_mask: AttitudeTargetTypemask,
5730}
5731impl ATTITUDE_TARGET_DATA {
5732 pub const ENCODED_LEN: usize = 37usize;
5733 pub const DEFAULT: Self = Self {
5734 time_boot_ms: 0_u32,
5735 q: [0.0_f32; 4usize],
5736 body_roll_rate: 0.0_f32,
5737 body_pitch_rate: 0.0_f32,
5738 body_yaw_rate: 0.0_f32,
5739 thrust: 0.0_f32,
5740 type_mask: AttitudeTargetTypemask::DEFAULT,
5741 };
5742 #[cfg(feature = "arbitrary")]
5743 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5744 use arbitrary::{Arbitrary, Unstructured};
5745 let mut buf = [0u8; 1024];
5746 rng.fill_bytes(&mut buf);
5747 let mut unstructured = Unstructured::new(&buf);
5748 Self::arbitrary(&mut unstructured).unwrap_or_default()
5749 }
5750}
5751impl Default for ATTITUDE_TARGET_DATA {
5752 fn default() -> Self {
5753 Self::DEFAULT.clone()
5754 }
5755}
5756impl MessageData for ATTITUDE_TARGET_DATA {
5757 type Message = MavMessage;
5758 const ID: u32 = 83u32;
5759 const NAME: &'static str = "ATTITUDE_TARGET";
5760 const EXTRA_CRC: u8 = 22u8;
5761 const ENCODED_LEN: usize = 37usize;
5762 fn deser(
5763 _version: MavlinkVersion,
5764 __input: &[u8],
5765 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5766 let avail_len = __input.len();
5767 let mut payload_buf = [0; Self::ENCODED_LEN];
5768 let mut buf = if avail_len < Self::ENCODED_LEN {
5769 payload_buf[0..avail_len].copy_from_slice(__input);
5770 Bytes::new(&payload_buf)
5771 } else {
5772 Bytes::new(__input)
5773 };
5774 let mut __struct = Self::default();
5775 __struct.time_boot_ms = buf.get_u32_le();
5776 for v in &mut __struct.q {
5777 let val = buf.get_f32_le();
5778 *v = val;
5779 }
5780 __struct.body_roll_rate = buf.get_f32_le();
5781 __struct.body_pitch_rate = buf.get_f32_le();
5782 __struct.body_yaw_rate = buf.get_f32_le();
5783 __struct.thrust = buf.get_f32_le();
5784 let tmp = buf.get_u8();
5785 __struct.type_mask =
5786 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
5787 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5788 flag_type: "AttitudeTargetTypemask",
5789 value: tmp as u64,
5790 })?;
5791 Ok(__struct)
5792 }
5793 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5794 let mut __tmp = BytesMut::new(bytes);
5795 #[allow(clippy::absurd_extreme_comparisons)]
5796 #[allow(unused_comparisons)]
5797 if __tmp.remaining() < Self::ENCODED_LEN {
5798 panic!(
5799 "buffer is too small (need {} bytes, but got {})",
5800 Self::ENCODED_LEN,
5801 __tmp.remaining(),
5802 )
5803 }
5804 __tmp.put_u32_le(self.time_boot_ms);
5805 for val in &self.q {
5806 __tmp.put_f32_le(*val);
5807 }
5808 __tmp.put_f32_le(self.body_roll_rate);
5809 __tmp.put_f32_le(self.body_pitch_rate);
5810 __tmp.put_f32_le(self.body_yaw_rate);
5811 __tmp.put_f32_le(self.thrust);
5812 __tmp.put_u8(self.type_mask.bits() as u8);
5813 if matches!(version, MavlinkVersion::V2) {
5814 let len = __tmp.len();
5815 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5816 } else {
5817 __tmp.len()
5818 }
5819 }
5820}
5821#[doc = "Motion capture attitude and position."]
5822#[doc = ""]
5823#[doc = "ID: 138"]
5824#[derive(Debug, Clone, PartialEq)]
5825#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5826#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5827#[cfg_attr(feature = "ts", derive(TS))]
5828#[cfg_attr(feature = "ts", ts(export))]
5829pub struct ATT_POS_MOCAP_DATA {
5830 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5831 pub time_usec: u64,
5832 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5833 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5834 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5835 pub q: [f32; 4],
5836 #[doc = "X position (NED)"]
5837 pub x: f32,
5838 #[doc = "Y position (NED)"]
5839 pub y: f32,
5840 #[doc = "Z position (NED)"]
5841 pub z: f32,
5842 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5843 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5844 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5845 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5846 pub covariance: [f32; 21],
5847}
5848impl ATT_POS_MOCAP_DATA {
5849 pub const ENCODED_LEN: usize = 120usize;
5850 pub const DEFAULT: Self = Self {
5851 time_usec: 0_u64,
5852 q: [0.0_f32; 4usize],
5853 x: 0.0_f32,
5854 y: 0.0_f32,
5855 z: 0.0_f32,
5856 covariance: [0.0_f32; 21usize],
5857 };
5858 #[cfg(feature = "arbitrary")]
5859 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5860 use arbitrary::{Arbitrary, Unstructured};
5861 let mut buf = [0u8; 1024];
5862 rng.fill_bytes(&mut buf);
5863 let mut unstructured = Unstructured::new(&buf);
5864 Self::arbitrary(&mut unstructured).unwrap_or_default()
5865 }
5866}
5867impl Default for ATT_POS_MOCAP_DATA {
5868 fn default() -> Self {
5869 Self::DEFAULT.clone()
5870 }
5871}
5872impl MessageData for ATT_POS_MOCAP_DATA {
5873 type Message = MavMessage;
5874 const ID: u32 = 138u32;
5875 const NAME: &'static str = "ATT_POS_MOCAP";
5876 const EXTRA_CRC: u8 = 109u8;
5877 const ENCODED_LEN: usize = 120usize;
5878 fn deser(
5879 _version: MavlinkVersion,
5880 __input: &[u8],
5881 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5882 let avail_len = __input.len();
5883 let mut payload_buf = [0; Self::ENCODED_LEN];
5884 let mut buf = if avail_len < Self::ENCODED_LEN {
5885 payload_buf[0..avail_len].copy_from_slice(__input);
5886 Bytes::new(&payload_buf)
5887 } else {
5888 Bytes::new(__input)
5889 };
5890 let mut __struct = Self::default();
5891 __struct.time_usec = buf.get_u64_le();
5892 for v in &mut __struct.q {
5893 let val = buf.get_f32_le();
5894 *v = val;
5895 }
5896 __struct.x = buf.get_f32_le();
5897 __struct.y = buf.get_f32_le();
5898 __struct.z = buf.get_f32_le();
5899 for v in &mut __struct.covariance {
5900 let val = buf.get_f32_le();
5901 *v = val;
5902 }
5903 Ok(__struct)
5904 }
5905 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5906 let mut __tmp = BytesMut::new(bytes);
5907 #[allow(clippy::absurd_extreme_comparisons)]
5908 #[allow(unused_comparisons)]
5909 if __tmp.remaining() < Self::ENCODED_LEN {
5910 panic!(
5911 "buffer is too small (need {} bytes, but got {})",
5912 Self::ENCODED_LEN,
5913 __tmp.remaining(),
5914 )
5915 }
5916 __tmp.put_u64_le(self.time_usec);
5917 for val in &self.q {
5918 __tmp.put_f32_le(*val);
5919 }
5920 __tmp.put_f32_le(self.x);
5921 __tmp.put_f32_le(self.y);
5922 __tmp.put_f32_le(self.z);
5923 if matches!(version, MavlinkVersion::V2) {
5924 for val in &self.covariance {
5925 __tmp.put_f32_le(*val);
5926 }
5927 let len = __tmp.len();
5928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5929 } else {
5930 __tmp.len()
5931 }
5932 }
5933}
5934#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5935#[doc = ""]
5936#[doc = "ID: 7"]
5937#[derive(Debug, Clone, PartialEq)]
5938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5940#[cfg_attr(feature = "ts", derive(TS))]
5941#[cfg_attr(feature = "ts", ts(export))]
5942pub struct AUTH_KEY_DATA {
5943 #[doc = "key"]
5944 #[cfg_attr(feature = "ts", ts(type = "string"))]
5945 pub key: CharArray<32>,
5946}
5947impl AUTH_KEY_DATA {
5948 pub const ENCODED_LEN: usize = 32usize;
5949 pub const DEFAULT: Self = Self {
5950 key: CharArray::new([0_u8; 32usize]),
5951 };
5952 #[cfg(feature = "arbitrary")]
5953 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5954 use arbitrary::{Arbitrary, Unstructured};
5955 let mut buf = [0u8; 1024];
5956 rng.fill_bytes(&mut buf);
5957 let mut unstructured = Unstructured::new(&buf);
5958 Self::arbitrary(&mut unstructured).unwrap_or_default()
5959 }
5960}
5961impl Default for AUTH_KEY_DATA {
5962 fn default() -> Self {
5963 Self::DEFAULT.clone()
5964 }
5965}
5966impl MessageData for AUTH_KEY_DATA {
5967 type Message = MavMessage;
5968 const ID: u32 = 7u32;
5969 const NAME: &'static str = "AUTH_KEY";
5970 const EXTRA_CRC: u8 = 119u8;
5971 const ENCODED_LEN: usize = 32usize;
5972 fn deser(
5973 _version: MavlinkVersion,
5974 __input: &[u8],
5975 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5976 let avail_len = __input.len();
5977 let mut payload_buf = [0; Self::ENCODED_LEN];
5978 let mut buf = if avail_len < Self::ENCODED_LEN {
5979 payload_buf[0..avail_len].copy_from_slice(__input);
5980 Bytes::new(&payload_buf)
5981 } else {
5982 Bytes::new(__input)
5983 };
5984 let mut __struct = Self::default();
5985 let mut tmp = [0_u8; 32usize];
5986 for v in &mut tmp {
5987 *v = buf.get_u8();
5988 }
5989 __struct.key = CharArray::new(tmp);
5990 Ok(__struct)
5991 }
5992 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5993 let mut __tmp = BytesMut::new(bytes);
5994 #[allow(clippy::absurd_extreme_comparisons)]
5995 #[allow(unused_comparisons)]
5996 if __tmp.remaining() < Self::ENCODED_LEN {
5997 panic!(
5998 "buffer is too small (need {} bytes, but got {})",
5999 Self::ENCODED_LEN,
6000 __tmp.remaining(),
6001 )
6002 }
6003 for val in &self.key {
6004 __tmp.put_u8(*val);
6005 }
6006 if matches!(version, MavlinkVersion::V2) {
6007 let len = __tmp.len();
6008 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6009 } else {
6010 __tmp.len()
6011 }
6012 }
6013}
6014#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
6015#[doc = ""]
6016#[doc = "ID: 286"]
6017#[derive(Debug, Clone, PartialEq)]
6018#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6019#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6020#[cfg_attr(feature = "ts", derive(TS))]
6021#[cfg_attr(feature = "ts", ts(export))]
6022pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6023 #[doc = "Timestamp (time since system boot)."]
6024 pub time_boot_us: u64,
6025 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
6026 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6027 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6028 pub q: [f32; 4],
6029 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
6030 pub q_estimated_delay_us: u32,
6031 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
6032 pub vx: f32,
6033 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
6034 pub vy: f32,
6035 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
6036 pub vz: f32,
6037 #[doc = "Estimated delay of the speed data. 0 if unknown."]
6038 pub v_estimated_delay_us: u32,
6039 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
6040 pub feed_forward_angular_velocity_z: f32,
6041 #[doc = "Bitmap indicating which estimator outputs are valid."]
6042 pub estimator_status: EstimatorStatusFlags,
6043 #[doc = "System ID"]
6044 pub target_system: u8,
6045 #[doc = "Component ID"]
6046 pub target_component: u8,
6047 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
6048 pub landed_state: MavLandedState,
6049 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
6050 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6051 pub angular_velocity_z: f32,
6052}
6053impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6054 pub const ENCODED_LEN: usize = 57usize;
6055 pub const DEFAULT: Self = Self {
6056 time_boot_us: 0_u64,
6057 q: [0.0_f32; 4usize],
6058 q_estimated_delay_us: 0_u32,
6059 vx: 0.0_f32,
6060 vy: 0.0_f32,
6061 vz: 0.0_f32,
6062 v_estimated_delay_us: 0_u32,
6063 feed_forward_angular_velocity_z: 0.0_f32,
6064 estimator_status: EstimatorStatusFlags::DEFAULT,
6065 target_system: 0_u8,
6066 target_component: 0_u8,
6067 landed_state: MavLandedState::DEFAULT,
6068 angular_velocity_z: 0.0_f32,
6069 };
6070 #[cfg(feature = "arbitrary")]
6071 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6072 use arbitrary::{Arbitrary, Unstructured};
6073 let mut buf = [0u8; 1024];
6074 rng.fill_bytes(&mut buf);
6075 let mut unstructured = Unstructured::new(&buf);
6076 Self::arbitrary(&mut unstructured).unwrap_or_default()
6077 }
6078}
6079impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6080 fn default() -> Self {
6081 Self::DEFAULT.clone()
6082 }
6083}
6084impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6085 type Message = MavMessage;
6086 const ID: u32 = 286u32;
6087 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6088 const EXTRA_CRC: u8 = 210u8;
6089 const ENCODED_LEN: usize = 57usize;
6090 fn deser(
6091 _version: MavlinkVersion,
6092 __input: &[u8],
6093 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6094 let avail_len = __input.len();
6095 let mut payload_buf = [0; Self::ENCODED_LEN];
6096 let mut buf = if avail_len < Self::ENCODED_LEN {
6097 payload_buf[0..avail_len].copy_from_slice(__input);
6098 Bytes::new(&payload_buf)
6099 } else {
6100 Bytes::new(__input)
6101 };
6102 let mut __struct = Self::default();
6103 __struct.time_boot_us = buf.get_u64_le();
6104 for v in &mut __struct.q {
6105 let val = buf.get_f32_le();
6106 *v = val;
6107 }
6108 __struct.q_estimated_delay_us = buf.get_u32_le();
6109 __struct.vx = buf.get_f32_le();
6110 __struct.vy = buf.get_f32_le();
6111 __struct.vz = buf.get_f32_le();
6112 __struct.v_estimated_delay_us = buf.get_u32_le();
6113 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
6114 let tmp = buf.get_u16_le();
6115 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6116 tmp as <EstimatorStatusFlags as Flags>::Bits,
6117 )
6118 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6119 flag_type: "EstimatorStatusFlags",
6120 value: tmp as u64,
6121 })?;
6122 __struct.target_system = buf.get_u8();
6123 __struct.target_component = buf.get_u8();
6124 let tmp = buf.get_u8();
6125 __struct.landed_state =
6126 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6127 enum_type: "MavLandedState",
6128 value: tmp as u64,
6129 })?;
6130 __struct.angular_velocity_z = buf.get_f32_le();
6131 Ok(__struct)
6132 }
6133 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6134 let mut __tmp = BytesMut::new(bytes);
6135 #[allow(clippy::absurd_extreme_comparisons)]
6136 #[allow(unused_comparisons)]
6137 if __tmp.remaining() < Self::ENCODED_LEN {
6138 panic!(
6139 "buffer is too small (need {} bytes, but got {})",
6140 Self::ENCODED_LEN,
6141 __tmp.remaining(),
6142 )
6143 }
6144 __tmp.put_u64_le(self.time_boot_us);
6145 for val in &self.q {
6146 __tmp.put_f32_le(*val);
6147 }
6148 __tmp.put_u32_le(self.q_estimated_delay_us);
6149 __tmp.put_f32_le(self.vx);
6150 __tmp.put_f32_le(self.vy);
6151 __tmp.put_f32_le(self.vz);
6152 __tmp.put_u32_le(self.v_estimated_delay_us);
6153 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6154 __tmp.put_u16_le(self.estimator_status.bits() as u16);
6155 __tmp.put_u8(self.target_system);
6156 __tmp.put_u8(self.target_component);
6157 __tmp.put_u8(self.landed_state as u8);
6158 if matches!(version, MavlinkVersion::V2) {
6159 __tmp.put_f32_le(self.angular_velocity_z);
6160 let len = __tmp.len();
6161 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6162 } else {
6163 __tmp.len()
6164 }
6165 }
6166}
6167#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6168#[doc = ""]
6169#[doc = "ID: 148"]
6170#[derive(Debug, Clone, PartialEq)]
6171#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6172#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6173#[cfg_attr(feature = "ts", derive(TS))]
6174#[cfg_attr(feature = "ts", ts(export))]
6175pub struct AUTOPILOT_VERSION_DATA {
6176 #[doc = "Bitmap of capabilities"]
6177 pub capabilities: MavProtocolCapability,
6178 #[doc = "UID if provided by hardware (see uid2)"]
6179 pub uid: u64,
6180 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6181 pub flight_sw_version: u32,
6182 #[doc = "Middleware version number"]
6183 pub middleware_sw_version: u32,
6184 #[doc = "Operating system version number"]
6185 pub os_sw_version: u32,
6186 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6187 pub board_version: u32,
6188 #[doc = "ID of the board vendor"]
6189 pub vendor_id: u16,
6190 #[doc = "ID of the product"]
6191 pub product_id: u16,
6192 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6193 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6194 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6195 pub flight_custom_version: [u8; 8],
6196 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6197 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6198 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6199 pub middleware_custom_version: [u8; 8],
6200 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6201 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6202 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6203 pub os_custom_version: [u8; 8],
6204 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6205 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6206 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6207 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6208 pub uid2: [u8; 18],
6209}
6210impl AUTOPILOT_VERSION_DATA {
6211 pub const ENCODED_LEN: usize = 78usize;
6212 pub const DEFAULT: Self = Self {
6213 capabilities: MavProtocolCapability::DEFAULT,
6214 uid: 0_u64,
6215 flight_sw_version: 0_u32,
6216 middleware_sw_version: 0_u32,
6217 os_sw_version: 0_u32,
6218 board_version: 0_u32,
6219 vendor_id: 0_u16,
6220 product_id: 0_u16,
6221 flight_custom_version: [0_u8; 8usize],
6222 middleware_custom_version: [0_u8; 8usize],
6223 os_custom_version: [0_u8; 8usize],
6224 uid2: [0_u8; 18usize],
6225 };
6226 #[cfg(feature = "arbitrary")]
6227 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6228 use arbitrary::{Arbitrary, Unstructured};
6229 let mut buf = [0u8; 1024];
6230 rng.fill_bytes(&mut buf);
6231 let mut unstructured = Unstructured::new(&buf);
6232 Self::arbitrary(&mut unstructured).unwrap_or_default()
6233 }
6234}
6235impl Default for AUTOPILOT_VERSION_DATA {
6236 fn default() -> Self {
6237 Self::DEFAULT.clone()
6238 }
6239}
6240impl MessageData for AUTOPILOT_VERSION_DATA {
6241 type Message = MavMessage;
6242 const ID: u32 = 148u32;
6243 const NAME: &'static str = "AUTOPILOT_VERSION";
6244 const EXTRA_CRC: u8 = 178u8;
6245 const ENCODED_LEN: usize = 78usize;
6246 fn deser(
6247 _version: MavlinkVersion,
6248 __input: &[u8],
6249 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6250 let avail_len = __input.len();
6251 let mut payload_buf = [0; Self::ENCODED_LEN];
6252 let mut buf = if avail_len < Self::ENCODED_LEN {
6253 payload_buf[0..avail_len].copy_from_slice(__input);
6254 Bytes::new(&payload_buf)
6255 } else {
6256 Bytes::new(__input)
6257 };
6258 let mut __struct = Self::default();
6259 let tmp = buf.get_u64_le();
6260 __struct.capabilities = MavProtocolCapability::from_bits(
6261 tmp as <MavProtocolCapability as Flags>::Bits,
6262 )
6263 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6264 flag_type: "MavProtocolCapability",
6265 value: tmp as u64,
6266 })?;
6267 __struct.uid = buf.get_u64_le();
6268 __struct.flight_sw_version = buf.get_u32_le();
6269 __struct.middleware_sw_version = buf.get_u32_le();
6270 __struct.os_sw_version = buf.get_u32_le();
6271 __struct.board_version = buf.get_u32_le();
6272 __struct.vendor_id = buf.get_u16_le();
6273 __struct.product_id = buf.get_u16_le();
6274 for v in &mut __struct.flight_custom_version {
6275 let val = buf.get_u8();
6276 *v = val;
6277 }
6278 for v in &mut __struct.middleware_custom_version {
6279 let val = buf.get_u8();
6280 *v = val;
6281 }
6282 for v in &mut __struct.os_custom_version {
6283 let val = buf.get_u8();
6284 *v = val;
6285 }
6286 for v in &mut __struct.uid2 {
6287 let val = buf.get_u8();
6288 *v = val;
6289 }
6290 Ok(__struct)
6291 }
6292 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6293 let mut __tmp = BytesMut::new(bytes);
6294 #[allow(clippy::absurd_extreme_comparisons)]
6295 #[allow(unused_comparisons)]
6296 if __tmp.remaining() < Self::ENCODED_LEN {
6297 panic!(
6298 "buffer is too small (need {} bytes, but got {})",
6299 Self::ENCODED_LEN,
6300 __tmp.remaining(),
6301 )
6302 }
6303 __tmp.put_u64_le(self.capabilities.bits() as u64);
6304 __tmp.put_u64_le(self.uid);
6305 __tmp.put_u32_le(self.flight_sw_version);
6306 __tmp.put_u32_le(self.middleware_sw_version);
6307 __tmp.put_u32_le(self.os_sw_version);
6308 __tmp.put_u32_le(self.board_version);
6309 __tmp.put_u16_le(self.vendor_id);
6310 __tmp.put_u16_le(self.product_id);
6311 for val in &self.flight_custom_version {
6312 __tmp.put_u8(*val);
6313 }
6314 for val in &self.middleware_custom_version {
6315 __tmp.put_u8(*val);
6316 }
6317 for val in &self.os_custom_version {
6318 __tmp.put_u8(*val);
6319 }
6320 if matches!(version, MavlinkVersion::V2) {
6321 for val in &self.uid2 {
6322 __tmp.put_u8(*val);
6323 }
6324 let len = __tmp.len();
6325 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6326 } else {
6327 __tmp.len()
6328 }
6329 }
6330}
6331#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6332#[doc = ""]
6333#[doc = "ID: 435"]
6334#[derive(Debug, Clone, PartialEq)]
6335#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6336#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6337#[cfg_attr(feature = "ts", derive(TS))]
6338#[cfg_attr(feature = "ts", ts(export))]
6339pub struct AVAILABLE_MODES_DATA {
6340 #[doc = "A bitfield for use for autopilot-specific flags"]
6341 pub custom_mode: u32,
6342 #[doc = "Mode properties."]
6343 pub properties: MavModeProperty,
6344 #[doc = "The total number of available modes for the current vehicle type."]
6345 pub number_modes: u8,
6346 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6347 pub mode_index: u8,
6348 #[doc = "Standard mode."]
6349 pub standard_mode: MavStandardMode,
6350 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6351 #[cfg_attr(feature = "ts", ts(type = "string"))]
6352 pub mode_name: CharArray<35>,
6353}
6354impl AVAILABLE_MODES_DATA {
6355 pub const ENCODED_LEN: usize = 46usize;
6356 pub const DEFAULT: Self = Self {
6357 custom_mode: 0_u32,
6358 properties: MavModeProperty::DEFAULT,
6359 number_modes: 0_u8,
6360 mode_index: 0_u8,
6361 standard_mode: MavStandardMode::DEFAULT,
6362 mode_name: CharArray::new([0_u8; 35usize]),
6363 };
6364 #[cfg(feature = "arbitrary")]
6365 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6366 use arbitrary::{Arbitrary, Unstructured};
6367 let mut buf = [0u8; 1024];
6368 rng.fill_bytes(&mut buf);
6369 let mut unstructured = Unstructured::new(&buf);
6370 Self::arbitrary(&mut unstructured).unwrap_or_default()
6371 }
6372}
6373impl Default for AVAILABLE_MODES_DATA {
6374 fn default() -> Self {
6375 Self::DEFAULT.clone()
6376 }
6377}
6378impl MessageData for AVAILABLE_MODES_DATA {
6379 type Message = MavMessage;
6380 const ID: u32 = 435u32;
6381 const NAME: &'static str = "AVAILABLE_MODES";
6382 const EXTRA_CRC: u8 = 134u8;
6383 const ENCODED_LEN: usize = 46usize;
6384 fn deser(
6385 _version: MavlinkVersion,
6386 __input: &[u8],
6387 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6388 let avail_len = __input.len();
6389 let mut payload_buf = [0; Self::ENCODED_LEN];
6390 let mut buf = if avail_len < Self::ENCODED_LEN {
6391 payload_buf[0..avail_len].copy_from_slice(__input);
6392 Bytes::new(&payload_buf)
6393 } else {
6394 Bytes::new(__input)
6395 };
6396 let mut __struct = Self::default();
6397 __struct.custom_mode = buf.get_u32_le();
6398 let tmp = buf.get_u32_le();
6399 __struct.properties = MavModeProperty::from_bits(tmp as <MavModeProperty as Flags>::Bits)
6400 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6401 flag_type: "MavModeProperty",
6402 value: tmp as u64,
6403 })?;
6404 __struct.number_modes = buf.get_u8();
6405 __struct.mode_index = buf.get_u8();
6406 let tmp = buf.get_u8();
6407 __struct.standard_mode =
6408 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6409 enum_type: "MavStandardMode",
6410 value: tmp as u64,
6411 })?;
6412 let mut tmp = [0_u8; 35usize];
6413 for v in &mut tmp {
6414 *v = buf.get_u8();
6415 }
6416 __struct.mode_name = CharArray::new(tmp);
6417 Ok(__struct)
6418 }
6419 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6420 let mut __tmp = BytesMut::new(bytes);
6421 #[allow(clippy::absurd_extreme_comparisons)]
6422 #[allow(unused_comparisons)]
6423 if __tmp.remaining() < Self::ENCODED_LEN {
6424 panic!(
6425 "buffer is too small (need {} bytes, but got {})",
6426 Self::ENCODED_LEN,
6427 __tmp.remaining(),
6428 )
6429 }
6430 __tmp.put_u32_le(self.custom_mode);
6431 __tmp.put_u32_le(self.properties.bits() as u32);
6432 __tmp.put_u8(self.number_modes);
6433 __tmp.put_u8(self.mode_index);
6434 __tmp.put_u8(self.standard_mode as u8);
6435 for val in &self.mode_name {
6436 __tmp.put_u8(*val);
6437 }
6438 if matches!(version, MavlinkVersion::V2) {
6439 let len = __tmp.len();
6440 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6441 } else {
6442 __tmp.len()
6443 }
6444 }
6445}
6446#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6447#[doc = ""]
6448#[doc = "ID: 437"]
6449#[derive(Debug, Clone, PartialEq)]
6450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6452#[cfg_attr(feature = "ts", derive(TS))]
6453#[cfg_attr(feature = "ts", ts(export))]
6454pub struct AVAILABLE_MODES_MONITOR_DATA {
6455 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6456 pub seq: u8,
6457}
6458impl AVAILABLE_MODES_MONITOR_DATA {
6459 pub const ENCODED_LEN: usize = 1usize;
6460 pub const DEFAULT: Self = Self { seq: 0_u8 };
6461 #[cfg(feature = "arbitrary")]
6462 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6463 use arbitrary::{Arbitrary, Unstructured};
6464 let mut buf = [0u8; 1024];
6465 rng.fill_bytes(&mut buf);
6466 let mut unstructured = Unstructured::new(&buf);
6467 Self::arbitrary(&mut unstructured).unwrap_or_default()
6468 }
6469}
6470impl Default for AVAILABLE_MODES_MONITOR_DATA {
6471 fn default() -> Self {
6472 Self::DEFAULT.clone()
6473 }
6474}
6475impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6476 type Message = MavMessage;
6477 const ID: u32 = 437u32;
6478 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6479 const EXTRA_CRC: u8 = 30u8;
6480 const ENCODED_LEN: usize = 1usize;
6481 fn deser(
6482 _version: MavlinkVersion,
6483 __input: &[u8],
6484 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6485 let avail_len = __input.len();
6486 let mut payload_buf = [0; Self::ENCODED_LEN];
6487 let mut buf = if avail_len < Self::ENCODED_LEN {
6488 payload_buf[0..avail_len].copy_from_slice(__input);
6489 Bytes::new(&payload_buf)
6490 } else {
6491 Bytes::new(__input)
6492 };
6493 let mut __struct = Self::default();
6494 __struct.seq = buf.get_u8();
6495 Ok(__struct)
6496 }
6497 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6498 let mut __tmp = BytesMut::new(bytes);
6499 #[allow(clippy::absurd_extreme_comparisons)]
6500 #[allow(unused_comparisons)]
6501 if __tmp.remaining() < Self::ENCODED_LEN {
6502 panic!(
6503 "buffer is too small (need {} bytes, but got {})",
6504 Self::ENCODED_LEN,
6505 __tmp.remaining(),
6506 )
6507 }
6508 __tmp.put_u8(self.seq);
6509 if matches!(version, MavlinkVersion::V2) {
6510 let len = __tmp.len();
6511 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6512 } else {
6513 __tmp.len()
6514 }
6515 }
6516}
6517#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6518#[doc = ""]
6519#[doc = "ID: 372"]
6520#[derive(Debug, Clone, PartialEq)]
6521#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6522#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6523#[cfg_attr(feature = "ts", derive(TS))]
6524#[cfg_attr(feature = "ts", ts(export))]
6525pub struct BATTERY_INFO_DATA {
6526 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6527 pub discharge_minimum_voltage: f32,
6528 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6529 pub charging_minimum_voltage: f32,
6530 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6531 pub resting_minimum_voltage: f32,
6532 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6533 pub charging_maximum_voltage: f32,
6534 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6535 pub charging_maximum_current: f32,
6536 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6537 pub nominal_voltage: f32,
6538 #[doc = "Maximum pack discharge current. 0: field not provided."]
6539 pub discharge_maximum_current: f32,
6540 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6541 pub discharge_maximum_burst_current: f32,
6542 #[doc = "Fully charged design capacity. 0: field not provided."]
6543 pub design_capacity: f32,
6544 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6545 pub full_charge_capacity: f32,
6546 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6547 pub cycle_count: u16,
6548 #[doc = "Battery weight. 0: field not provided."]
6549 pub weight: u16,
6550 #[doc = "Battery ID"]
6551 pub id: u8,
6552 #[doc = "Function of the battery."]
6553 pub battery_function: MavBatteryFunction,
6554 #[doc = "Type (chemistry) of the battery."]
6555 pub mavtype: MavBatteryType,
6556 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6557 pub state_of_health: u8,
6558 #[doc = "Number of battery cells in series. 0: field not provided."]
6559 pub cells_in_series: u8,
6560 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6561 #[cfg_attr(feature = "ts", ts(type = "string"))]
6562 pub manufacture_date: CharArray<9>,
6563 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6564 #[cfg_attr(feature = "ts", ts(type = "string"))]
6565 pub serial_number: CharArray<32>,
6566 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6567 #[cfg_attr(feature = "ts", ts(type = "string"))]
6568 pub name: CharArray<50>,
6569}
6570impl BATTERY_INFO_DATA {
6571 pub const ENCODED_LEN: usize = 140usize;
6572 pub const DEFAULT: Self = Self {
6573 discharge_minimum_voltage: 0.0_f32,
6574 charging_minimum_voltage: 0.0_f32,
6575 resting_minimum_voltage: 0.0_f32,
6576 charging_maximum_voltage: 0.0_f32,
6577 charging_maximum_current: 0.0_f32,
6578 nominal_voltage: 0.0_f32,
6579 discharge_maximum_current: 0.0_f32,
6580 discharge_maximum_burst_current: 0.0_f32,
6581 design_capacity: 0.0_f32,
6582 full_charge_capacity: 0.0_f32,
6583 cycle_count: 0_u16,
6584 weight: 0_u16,
6585 id: 0_u8,
6586 battery_function: MavBatteryFunction::DEFAULT,
6587 mavtype: MavBatteryType::DEFAULT,
6588 state_of_health: 0_u8,
6589 cells_in_series: 0_u8,
6590 manufacture_date: CharArray::new([0_u8; 9usize]),
6591 serial_number: CharArray::new([0_u8; 32usize]),
6592 name: CharArray::new([0_u8; 50usize]),
6593 };
6594 #[cfg(feature = "arbitrary")]
6595 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6596 use arbitrary::{Arbitrary, Unstructured};
6597 let mut buf = [0u8; 1024];
6598 rng.fill_bytes(&mut buf);
6599 let mut unstructured = Unstructured::new(&buf);
6600 Self::arbitrary(&mut unstructured).unwrap_or_default()
6601 }
6602}
6603impl Default for BATTERY_INFO_DATA {
6604 fn default() -> Self {
6605 Self::DEFAULT.clone()
6606 }
6607}
6608impl MessageData for BATTERY_INFO_DATA {
6609 type Message = MavMessage;
6610 const ID: u32 = 372u32;
6611 const NAME: &'static str = "BATTERY_INFO";
6612 const EXTRA_CRC: u8 = 26u8;
6613 const ENCODED_LEN: usize = 140usize;
6614 fn deser(
6615 _version: MavlinkVersion,
6616 __input: &[u8],
6617 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6618 let avail_len = __input.len();
6619 let mut payload_buf = [0; Self::ENCODED_LEN];
6620 let mut buf = if avail_len < Self::ENCODED_LEN {
6621 payload_buf[0..avail_len].copy_from_slice(__input);
6622 Bytes::new(&payload_buf)
6623 } else {
6624 Bytes::new(__input)
6625 };
6626 let mut __struct = Self::default();
6627 __struct.discharge_minimum_voltage = buf.get_f32_le();
6628 __struct.charging_minimum_voltage = buf.get_f32_le();
6629 __struct.resting_minimum_voltage = buf.get_f32_le();
6630 __struct.charging_maximum_voltage = buf.get_f32_le();
6631 __struct.charging_maximum_current = buf.get_f32_le();
6632 __struct.nominal_voltage = buf.get_f32_le();
6633 __struct.discharge_maximum_current = buf.get_f32_le();
6634 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6635 __struct.design_capacity = buf.get_f32_le();
6636 __struct.full_charge_capacity = buf.get_f32_le();
6637 __struct.cycle_count = buf.get_u16_le();
6638 __struct.weight = buf.get_u16_le();
6639 __struct.id = buf.get_u8();
6640 let tmp = buf.get_u8();
6641 __struct.battery_function =
6642 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6643 enum_type: "MavBatteryFunction",
6644 value: tmp as u64,
6645 })?;
6646 let tmp = buf.get_u8();
6647 __struct.mavtype =
6648 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6649 enum_type: "MavBatteryType",
6650 value: tmp as u64,
6651 })?;
6652 __struct.state_of_health = buf.get_u8();
6653 __struct.cells_in_series = buf.get_u8();
6654 let mut tmp = [0_u8; 9usize];
6655 for v in &mut tmp {
6656 *v = buf.get_u8();
6657 }
6658 __struct.manufacture_date = CharArray::new(tmp);
6659 let mut tmp = [0_u8; 32usize];
6660 for v in &mut tmp {
6661 *v = buf.get_u8();
6662 }
6663 __struct.serial_number = CharArray::new(tmp);
6664 let mut tmp = [0_u8; 50usize];
6665 for v in &mut tmp {
6666 *v = buf.get_u8();
6667 }
6668 __struct.name = CharArray::new(tmp);
6669 Ok(__struct)
6670 }
6671 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6672 let mut __tmp = BytesMut::new(bytes);
6673 #[allow(clippy::absurd_extreme_comparisons)]
6674 #[allow(unused_comparisons)]
6675 if __tmp.remaining() < Self::ENCODED_LEN {
6676 panic!(
6677 "buffer is too small (need {} bytes, but got {})",
6678 Self::ENCODED_LEN,
6679 __tmp.remaining(),
6680 )
6681 }
6682 __tmp.put_f32_le(self.discharge_minimum_voltage);
6683 __tmp.put_f32_le(self.charging_minimum_voltage);
6684 __tmp.put_f32_le(self.resting_minimum_voltage);
6685 __tmp.put_f32_le(self.charging_maximum_voltage);
6686 __tmp.put_f32_le(self.charging_maximum_current);
6687 __tmp.put_f32_le(self.nominal_voltage);
6688 __tmp.put_f32_le(self.discharge_maximum_current);
6689 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6690 __tmp.put_f32_le(self.design_capacity);
6691 __tmp.put_f32_le(self.full_charge_capacity);
6692 __tmp.put_u16_le(self.cycle_count);
6693 __tmp.put_u16_le(self.weight);
6694 __tmp.put_u8(self.id);
6695 __tmp.put_u8(self.battery_function as u8);
6696 __tmp.put_u8(self.mavtype as u8);
6697 __tmp.put_u8(self.state_of_health);
6698 __tmp.put_u8(self.cells_in_series);
6699 for val in &self.manufacture_date {
6700 __tmp.put_u8(*val);
6701 }
6702 for val in &self.serial_number {
6703 __tmp.put_u8(*val);
6704 }
6705 for val in &self.name {
6706 __tmp.put_u8(*val);
6707 }
6708 if matches!(version, MavlinkVersion::V2) {
6709 let len = __tmp.len();
6710 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6711 } else {
6712 __tmp.len()
6713 }
6714 }
6715}
6716#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6717#[doc = ""]
6718#[doc = "ID: 147"]
6719#[derive(Debug, Clone, PartialEq)]
6720#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6721#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6722#[cfg_attr(feature = "ts", derive(TS))]
6723#[cfg_attr(feature = "ts", ts(export))]
6724pub struct BATTERY_STATUS_DATA {
6725 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6726 pub current_consumed: i32,
6727 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6728 pub energy_consumed: i32,
6729 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6730 pub temperature: i16,
6731 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6732 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6733 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6734 pub voltages: [u16; 10],
6735 #[doc = "Battery current, -1: autopilot does not measure the current"]
6736 pub current_battery: i16,
6737 #[doc = "Battery ID"]
6738 pub id: u8,
6739 #[doc = "Function of the battery"]
6740 pub battery_function: MavBatteryFunction,
6741 #[doc = "Type (chemistry) of the battery"]
6742 pub mavtype: MavBatteryType,
6743 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6744 pub battery_remaining: i8,
6745 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6746 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6747 pub time_remaining: i32,
6748 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6749 #[cfg_attr(feature = "serde", serde(default))]
6750 pub charge_state: MavBatteryChargeState,
6751 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6752 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6753 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6754 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6755 pub voltages_ext: [u16; 4],
6756 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6757 #[cfg_attr(feature = "serde", serde(default))]
6758 pub mode: MavBatteryMode,
6759 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6760 #[cfg_attr(feature = "serde", serde(default))]
6761 pub fault_bitmask: MavBatteryFault,
6762}
6763impl BATTERY_STATUS_DATA {
6764 pub const ENCODED_LEN: usize = 54usize;
6765 pub const DEFAULT: Self = Self {
6766 current_consumed: 0_i32,
6767 energy_consumed: 0_i32,
6768 temperature: 0_i16,
6769 voltages: [0_u16; 10usize],
6770 current_battery: 0_i16,
6771 id: 0_u8,
6772 battery_function: MavBatteryFunction::DEFAULT,
6773 mavtype: MavBatteryType::DEFAULT,
6774 battery_remaining: 0_i8,
6775 time_remaining: 0_i32,
6776 charge_state: MavBatteryChargeState::DEFAULT,
6777 voltages_ext: [0_u16; 4usize],
6778 mode: MavBatteryMode::DEFAULT,
6779 fault_bitmask: MavBatteryFault::DEFAULT,
6780 };
6781 #[cfg(feature = "arbitrary")]
6782 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6783 use arbitrary::{Arbitrary, Unstructured};
6784 let mut buf = [0u8; 1024];
6785 rng.fill_bytes(&mut buf);
6786 let mut unstructured = Unstructured::new(&buf);
6787 Self::arbitrary(&mut unstructured).unwrap_or_default()
6788 }
6789}
6790impl Default for BATTERY_STATUS_DATA {
6791 fn default() -> Self {
6792 Self::DEFAULT.clone()
6793 }
6794}
6795impl MessageData for BATTERY_STATUS_DATA {
6796 type Message = MavMessage;
6797 const ID: u32 = 147u32;
6798 const NAME: &'static str = "BATTERY_STATUS";
6799 const EXTRA_CRC: u8 = 154u8;
6800 const ENCODED_LEN: usize = 54usize;
6801 fn deser(
6802 _version: MavlinkVersion,
6803 __input: &[u8],
6804 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6805 let avail_len = __input.len();
6806 let mut payload_buf = [0; Self::ENCODED_LEN];
6807 let mut buf = if avail_len < Self::ENCODED_LEN {
6808 payload_buf[0..avail_len].copy_from_slice(__input);
6809 Bytes::new(&payload_buf)
6810 } else {
6811 Bytes::new(__input)
6812 };
6813 let mut __struct = Self::default();
6814 __struct.current_consumed = buf.get_i32_le();
6815 __struct.energy_consumed = buf.get_i32_le();
6816 __struct.temperature = buf.get_i16_le();
6817 for v in &mut __struct.voltages {
6818 let val = buf.get_u16_le();
6819 *v = val;
6820 }
6821 __struct.current_battery = buf.get_i16_le();
6822 __struct.id = buf.get_u8();
6823 let tmp = buf.get_u8();
6824 __struct.battery_function =
6825 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6826 enum_type: "MavBatteryFunction",
6827 value: tmp as u64,
6828 })?;
6829 let tmp = buf.get_u8();
6830 __struct.mavtype =
6831 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6832 enum_type: "MavBatteryType",
6833 value: tmp as u64,
6834 })?;
6835 __struct.battery_remaining = buf.get_i8();
6836 __struct.time_remaining = buf.get_i32_le();
6837 let tmp = buf.get_u8();
6838 __struct.charge_state =
6839 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6840 enum_type: "MavBatteryChargeState",
6841 value: tmp as u64,
6842 })?;
6843 for v in &mut __struct.voltages_ext {
6844 let val = buf.get_u16_le();
6845 *v = val;
6846 }
6847 let tmp = buf.get_u8();
6848 __struct.mode =
6849 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6850 enum_type: "MavBatteryMode",
6851 value: tmp as u64,
6852 })?;
6853 let tmp = buf.get_u32_le();
6854 __struct.fault_bitmask = MavBatteryFault::from_bits(
6855 tmp as <MavBatteryFault as Flags>::Bits,
6856 )
6857 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6858 flag_type: "MavBatteryFault",
6859 value: tmp as u64,
6860 })?;
6861 Ok(__struct)
6862 }
6863 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6864 let mut __tmp = BytesMut::new(bytes);
6865 #[allow(clippy::absurd_extreme_comparisons)]
6866 #[allow(unused_comparisons)]
6867 if __tmp.remaining() < Self::ENCODED_LEN {
6868 panic!(
6869 "buffer is too small (need {} bytes, but got {})",
6870 Self::ENCODED_LEN,
6871 __tmp.remaining(),
6872 )
6873 }
6874 __tmp.put_i32_le(self.current_consumed);
6875 __tmp.put_i32_le(self.energy_consumed);
6876 __tmp.put_i16_le(self.temperature);
6877 for val in &self.voltages {
6878 __tmp.put_u16_le(*val);
6879 }
6880 __tmp.put_i16_le(self.current_battery);
6881 __tmp.put_u8(self.id);
6882 __tmp.put_u8(self.battery_function as u8);
6883 __tmp.put_u8(self.mavtype as u8);
6884 __tmp.put_i8(self.battery_remaining);
6885 if matches!(version, MavlinkVersion::V2) {
6886 __tmp.put_i32_le(self.time_remaining);
6887 __tmp.put_u8(self.charge_state as u8);
6888 for val in &self.voltages_ext {
6889 __tmp.put_u16_le(*val);
6890 }
6891 __tmp.put_u8(self.mode as u8);
6892 __tmp.put_u32_le(self.fault_bitmask.bits() as u32);
6893 let len = __tmp.len();
6894 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6895 } else {
6896 __tmp.len()
6897 }
6898 }
6899}
6900#[doc = "Report button state change."]
6901#[doc = ""]
6902#[doc = "ID: 257"]
6903#[derive(Debug, Clone, PartialEq)]
6904#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6905#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6906#[cfg_attr(feature = "ts", derive(TS))]
6907#[cfg_attr(feature = "ts", ts(export))]
6908pub struct BUTTON_CHANGE_DATA {
6909 #[doc = "Timestamp (time since system boot)."]
6910 pub time_boot_ms: u32,
6911 #[doc = "Time of last change of button state."]
6912 pub last_change_ms: u32,
6913 #[doc = "Bitmap for state of buttons."]
6914 pub state: u8,
6915}
6916impl BUTTON_CHANGE_DATA {
6917 pub const ENCODED_LEN: usize = 9usize;
6918 pub const DEFAULT: Self = Self {
6919 time_boot_ms: 0_u32,
6920 last_change_ms: 0_u32,
6921 state: 0_u8,
6922 };
6923 #[cfg(feature = "arbitrary")]
6924 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6925 use arbitrary::{Arbitrary, Unstructured};
6926 let mut buf = [0u8; 1024];
6927 rng.fill_bytes(&mut buf);
6928 let mut unstructured = Unstructured::new(&buf);
6929 Self::arbitrary(&mut unstructured).unwrap_or_default()
6930 }
6931}
6932impl Default for BUTTON_CHANGE_DATA {
6933 fn default() -> Self {
6934 Self::DEFAULT.clone()
6935 }
6936}
6937impl MessageData for BUTTON_CHANGE_DATA {
6938 type Message = MavMessage;
6939 const ID: u32 = 257u32;
6940 const NAME: &'static str = "BUTTON_CHANGE";
6941 const EXTRA_CRC: u8 = 131u8;
6942 const ENCODED_LEN: usize = 9usize;
6943 fn deser(
6944 _version: MavlinkVersion,
6945 __input: &[u8],
6946 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6947 let avail_len = __input.len();
6948 let mut payload_buf = [0; Self::ENCODED_LEN];
6949 let mut buf = if avail_len < Self::ENCODED_LEN {
6950 payload_buf[0..avail_len].copy_from_slice(__input);
6951 Bytes::new(&payload_buf)
6952 } else {
6953 Bytes::new(__input)
6954 };
6955 let mut __struct = Self::default();
6956 __struct.time_boot_ms = buf.get_u32_le();
6957 __struct.last_change_ms = buf.get_u32_le();
6958 __struct.state = buf.get_u8();
6959 Ok(__struct)
6960 }
6961 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6962 let mut __tmp = BytesMut::new(bytes);
6963 #[allow(clippy::absurd_extreme_comparisons)]
6964 #[allow(unused_comparisons)]
6965 if __tmp.remaining() < Self::ENCODED_LEN {
6966 panic!(
6967 "buffer is too small (need {} bytes, but got {})",
6968 Self::ENCODED_LEN,
6969 __tmp.remaining(),
6970 )
6971 }
6972 __tmp.put_u32_le(self.time_boot_ms);
6973 __tmp.put_u32_le(self.last_change_ms);
6974 __tmp.put_u8(self.state);
6975 if matches!(version, MavlinkVersion::V2) {
6976 let len = __tmp.len();
6977 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6978 } else {
6979 __tmp.len()
6980 }
6981 }
6982}
6983#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6984#[doc = ""]
6985#[doc = "ID: 262"]
6986#[derive(Debug, Clone, PartialEq)]
6987#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6988#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6989#[cfg_attr(feature = "ts", derive(TS))]
6990#[cfg_attr(feature = "ts", ts(export))]
6991pub struct CAMERA_CAPTURE_STATUS_DATA {
6992 #[doc = "Timestamp (time since system boot)."]
6993 pub time_boot_ms: u32,
6994 #[doc = "Image capture interval"]
6995 pub image_interval: f32,
6996 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
6997 pub recording_time_ms: u32,
6998 #[doc = "Available storage capacity."]
6999 pub available_capacity: f32,
7000 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
7001 pub image_status: u8,
7002 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
7003 pub video_status: u8,
7004 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
7005 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7006 pub image_count: i32,
7007 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7008 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7009 pub camera_device_id: u8,
7010}
7011impl CAMERA_CAPTURE_STATUS_DATA {
7012 pub const ENCODED_LEN: usize = 23usize;
7013 pub const DEFAULT: Self = Self {
7014 time_boot_ms: 0_u32,
7015 image_interval: 0.0_f32,
7016 recording_time_ms: 0_u32,
7017 available_capacity: 0.0_f32,
7018 image_status: 0_u8,
7019 video_status: 0_u8,
7020 image_count: 0_i32,
7021 camera_device_id: 0_u8,
7022 };
7023 #[cfg(feature = "arbitrary")]
7024 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7025 use arbitrary::{Arbitrary, Unstructured};
7026 let mut buf = [0u8; 1024];
7027 rng.fill_bytes(&mut buf);
7028 let mut unstructured = Unstructured::new(&buf);
7029 Self::arbitrary(&mut unstructured).unwrap_or_default()
7030 }
7031}
7032impl Default for CAMERA_CAPTURE_STATUS_DATA {
7033 fn default() -> Self {
7034 Self::DEFAULT.clone()
7035 }
7036}
7037impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7038 type Message = MavMessage;
7039 const ID: u32 = 262u32;
7040 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7041 const EXTRA_CRC: u8 = 12u8;
7042 const ENCODED_LEN: usize = 23usize;
7043 fn deser(
7044 _version: MavlinkVersion,
7045 __input: &[u8],
7046 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7047 let avail_len = __input.len();
7048 let mut payload_buf = [0; Self::ENCODED_LEN];
7049 let mut buf = if avail_len < Self::ENCODED_LEN {
7050 payload_buf[0..avail_len].copy_from_slice(__input);
7051 Bytes::new(&payload_buf)
7052 } else {
7053 Bytes::new(__input)
7054 };
7055 let mut __struct = Self::default();
7056 __struct.time_boot_ms = buf.get_u32_le();
7057 __struct.image_interval = buf.get_f32_le();
7058 __struct.recording_time_ms = buf.get_u32_le();
7059 __struct.available_capacity = buf.get_f32_le();
7060 __struct.image_status = buf.get_u8();
7061 __struct.video_status = buf.get_u8();
7062 __struct.image_count = buf.get_i32_le();
7063 __struct.camera_device_id = buf.get_u8();
7064 Ok(__struct)
7065 }
7066 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7067 let mut __tmp = BytesMut::new(bytes);
7068 #[allow(clippy::absurd_extreme_comparisons)]
7069 #[allow(unused_comparisons)]
7070 if __tmp.remaining() < Self::ENCODED_LEN {
7071 panic!(
7072 "buffer is too small (need {} bytes, but got {})",
7073 Self::ENCODED_LEN,
7074 __tmp.remaining(),
7075 )
7076 }
7077 __tmp.put_u32_le(self.time_boot_ms);
7078 __tmp.put_f32_le(self.image_interval);
7079 __tmp.put_u32_le(self.recording_time_ms);
7080 __tmp.put_f32_le(self.available_capacity);
7081 __tmp.put_u8(self.image_status);
7082 __tmp.put_u8(self.video_status);
7083 if matches!(version, MavlinkVersion::V2) {
7084 __tmp.put_i32_le(self.image_count);
7085 __tmp.put_u8(self.camera_device_id);
7086 let len = __tmp.len();
7087 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7088 } else {
7089 __tmp.len()
7090 }
7091 }
7092}
7093#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7094#[doc = ""]
7095#[doc = "ID: 271"]
7096#[derive(Debug, Clone, PartialEq)]
7097#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7098#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7099#[cfg_attr(feature = "ts", derive(TS))]
7100#[cfg_attr(feature = "ts", ts(export))]
7101pub struct CAMERA_FOV_STATUS_DATA {
7102 #[doc = "Timestamp (time since system boot)."]
7103 pub time_boot_ms: u32,
7104 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7105 pub lat_camera: i32,
7106 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7107 pub lon_camera: i32,
7108 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7109 pub alt_camera: i32,
7110 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7111 pub lat_image: i32,
7112 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7113 pub lon_image: i32,
7114 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7115 pub alt_image: i32,
7116 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7117 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7118 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7119 pub q: [f32; 4],
7120 #[doc = "Horizontal field of view (NaN if unknown)."]
7121 pub hfov: f32,
7122 #[doc = "Vertical field of view (NaN if unknown)."]
7123 pub vfov: f32,
7124 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7125 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7126 pub camera_device_id: u8,
7127}
7128impl CAMERA_FOV_STATUS_DATA {
7129 pub const ENCODED_LEN: usize = 53usize;
7130 pub const DEFAULT: Self = Self {
7131 time_boot_ms: 0_u32,
7132 lat_camera: 0_i32,
7133 lon_camera: 0_i32,
7134 alt_camera: 0_i32,
7135 lat_image: 0_i32,
7136 lon_image: 0_i32,
7137 alt_image: 0_i32,
7138 q: [0.0_f32; 4usize],
7139 hfov: 0.0_f32,
7140 vfov: 0.0_f32,
7141 camera_device_id: 0_u8,
7142 };
7143 #[cfg(feature = "arbitrary")]
7144 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7145 use arbitrary::{Arbitrary, Unstructured};
7146 let mut buf = [0u8; 1024];
7147 rng.fill_bytes(&mut buf);
7148 let mut unstructured = Unstructured::new(&buf);
7149 Self::arbitrary(&mut unstructured).unwrap_or_default()
7150 }
7151}
7152impl Default for CAMERA_FOV_STATUS_DATA {
7153 fn default() -> Self {
7154 Self::DEFAULT.clone()
7155 }
7156}
7157impl MessageData for CAMERA_FOV_STATUS_DATA {
7158 type Message = MavMessage;
7159 const ID: u32 = 271u32;
7160 const NAME: &'static str = "CAMERA_FOV_STATUS";
7161 const EXTRA_CRC: u8 = 22u8;
7162 const ENCODED_LEN: usize = 53usize;
7163 fn deser(
7164 _version: MavlinkVersion,
7165 __input: &[u8],
7166 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7167 let avail_len = __input.len();
7168 let mut payload_buf = [0; Self::ENCODED_LEN];
7169 let mut buf = if avail_len < Self::ENCODED_LEN {
7170 payload_buf[0..avail_len].copy_from_slice(__input);
7171 Bytes::new(&payload_buf)
7172 } else {
7173 Bytes::new(__input)
7174 };
7175 let mut __struct = Self::default();
7176 __struct.time_boot_ms = buf.get_u32_le();
7177 __struct.lat_camera = buf.get_i32_le();
7178 __struct.lon_camera = buf.get_i32_le();
7179 __struct.alt_camera = buf.get_i32_le();
7180 __struct.lat_image = buf.get_i32_le();
7181 __struct.lon_image = buf.get_i32_le();
7182 __struct.alt_image = buf.get_i32_le();
7183 for v in &mut __struct.q {
7184 let val = buf.get_f32_le();
7185 *v = val;
7186 }
7187 __struct.hfov = buf.get_f32_le();
7188 __struct.vfov = buf.get_f32_le();
7189 __struct.camera_device_id = buf.get_u8();
7190 Ok(__struct)
7191 }
7192 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7193 let mut __tmp = BytesMut::new(bytes);
7194 #[allow(clippy::absurd_extreme_comparisons)]
7195 #[allow(unused_comparisons)]
7196 if __tmp.remaining() < Self::ENCODED_LEN {
7197 panic!(
7198 "buffer is too small (need {} bytes, but got {})",
7199 Self::ENCODED_LEN,
7200 __tmp.remaining(),
7201 )
7202 }
7203 __tmp.put_u32_le(self.time_boot_ms);
7204 __tmp.put_i32_le(self.lat_camera);
7205 __tmp.put_i32_le(self.lon_camera);
7206 __tmp.put_i32_le(self.alt_camera);
7207 __tmp.put_i32_le(self.lat_image);
7208 __tmp.put_i32_le(self.lon_image);
7209 __tmp.put_i32_le(self.alt_image);
7210 for val in &self.q {
7211 __tmp.put_f32_le(*val);
7212 }
7213 __tmp.put_f32_le(self.hfov);
7214 __tmp.put_f32_le(self.vfov);
7215 if matches!(version, MavlinkVersion::V2) {
7216 __tmp.put_u8(self.camera_device_id);
7217 let len = __tmp.len();
7218 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7219 } else {
7220 __tmp.len()
7221 }
7222 }
7223}
7224#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7225#[doc = ""]
7226#[doc = "ID: 263"]
7227#[derive(Debug, Clone, PartialEq)]
7228#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7229#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7230#[cfg_attr(feature = "ts", derive(TS))]
7231#[cfg_attr(feature = "ts", ts(export))]
7232pub struct CAMERA_IMAGE_CAPTURED_DATA {
7233 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7234 pub time_utc: u64,
7235 #[doc = "Timestamp (time since system boot)."]
7236 pub time_boot_ms: u32,
7237 #[doc = "Latitude where image was taken"]
7238 pub lat: i32,
7239 #[doc = "Longitude where capture was taken"]
7240 pub lon: i32,
7241 #[doc = "Altitude (MSL) where image was taken"]
7242 pub alt: i32,
7243 #[doc = "Altitude above ground"]
7244 pub relative_alt: i32,
7245 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7246 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7247 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7248 pub q: [f32; 4],
7249 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7250 pub image_index: i32,
7251 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7252 pub camera_id: u8,
7253 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7254 pub capture_result: i8,
7255 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7256 #[cfg_attr(feature = "ts", ts(type = "string"))]
7257 pub file_url: CharArray<205>,
7258}
7259impl CAMERA_IMAGE_CAPTURED_DATA {
7260 pub const ENCODED_LEN: usize = 255usize;
7261 pub const DEFAULT: Self = Self {
7262 time_utc: 0_u64,
7263 time_boot_ms: 0_u32,
7264 lat: 0_i32,
7265 lon: 0_i32,
7266 alt: 0_i32,
7267 relative_alt: 0_i32,
7268 q: [0.0_f32; 4usize],
7269 image_index: 0_i32,
7270 camera_id: 0_u8,
7271 capture_result: 0_i8,
7272 file_url: CharArray::new([0_u8; 205usize]),
7273 };
7274 #[cfg(feature = "arbitrary")]
7275 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7276 use arbitrary::{Arbitrary, Unstructured};
7277 let mut buf = [0u8; 1024];
7278 rng.fill_bytes(&mut buf);
7279 let mut unstructured = Unstructured::new(&buf);
7280 Self::arbitrary(&mut unstructured).unwrap_or_default()
7281 }
7282}
7283impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7284 fn default() -> Self {
7285 Self::DEFAULT.clone()
7286 }
7287}
7288impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7289 type Message = MavMessage;
7290 const ID: u32 = 263u32;
7291 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7292 const EXTRA_CRC: u8 = 133u8;
7293 const ENCODED_LEN: usize = 255usize;
7294 fn deser(
7295 _version: MavlinkVersion,
7296 __input: &[u8],
7297 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7298 let avail_len = __input.len();
7299 let mut payload_buf = [0; Self::ENCODED_LEN];
7300 let mut buf = if avail_len < Self::ENCODED_LEN {
7301 payload_buf[0..avail_len].copy_from_slice(__input);
7302 Bytes::new(&payload_buf)
7303 } else {
7304 Bytes::new(__input)
7305 };
7306 let mut __struct = Self::default();
7307 __struct.time_utc = buf.get_u64_le();
7308 __struct.time_boot_ms = buf.get_u32_le();
7309 __struct.lat = buf.get_i32_le();
7310 __struct.lon = buf.get_i32_le();
7311 __struct.alt = buf.get_i32_le();
7312 __struct.relative_alt = buf.get_i32_le();
7313 for v in &mut __struct.q {
7314 let val = buf.get_f32_le();
7315 *v = val;
7316 }
7317 __struct.image_index = buf.get_i32_le();
7318 __struct.camera_id = buf.get_u8();
7319 __struct.capture_result = buf.get_i8();
7320 let mut tmp = [0_u8; 205usize];
7321 for v in &mut tmp {
7322 *v = buf.get_u8();
7323 }
7324 __struct.file_url = CharArray::new(tmp);
7325 Ok(__struct)
7326 }
7327 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7328 let mut __tmp = BytesMut::new(bytes);
7329 #[allow(clippy::absurd_extreme_comparisons)]
7330 #[allow(unused_comparisons)]
7331 if __tmp.remaining() < Self::ENCODED_LEN {
7332 panic!(
7333 "buffer is too small (need {} bytes, but got {})",
7334 Self::ENCODED_LEN,
7335 __tmp.remaining(),
7336 )
7337 }
7338 __tmp.put_u64_le(self.time_utc);
7339 __tmp.put_u32_le(self.time_boot_ms);
7340 __tmp.put_i32_le(self.lat);
7341 __tmp.put_i32_le(self.lon);
7342 __tmp.put_i32_le(self.alt);
7343 __tmp.put_i32_le(self.relative_alt);
7344 for val in &self.q {
7345 __tmp.put_f32_le(*val);
7346 }
7347 __tmp.put_i32_le(self.image_index);
7348 __tmp.put_u8(self.camera_id);
7349 __tmp.put_i8(self.capture_result);
7350 for val in &self.file_url {
7351 __tmp.put_u8(*val);
7352 }
7353 if matches!(version, MavlinkVersion::V2) {
7354 let len = __tmp.len();
7355 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7356 } else {
7357 __tmp.len()
7358 }
7359 }
7360}
7361#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7362#[doc = ""]
7363#[doc = "ID: 259"]
7364#[derive(Debug, Clone, PartialEq)]
7365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7367#[cfg_attr(feature = "ts", derive(TS))]
7368#[cfg_attr(feature = "ts", ts(export))]
7369pub struct CAMERA_INFORMATION_DATA {
7370 #[doc = "Timestamp (time since system boot)."]
7371 pub time_boot_ms: u32,
7372 #[doc = "0xff). Use 0 if not known."]
7373 pub firmware_version: u32,
7374 #[doc = "Focal length. Use NaN if not known."]
7375 pub focal_length: f32,
7376 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7377 pub sensor_size_h: f32,
7378 #[doc = "Image sensor size vertical. Use NaN if not known."]
7379 pub sensor_size_v: f32,
7380 #[doc = "Bitmap of camera capability flags."]
7381 pub flags: CameraCapFlags,
7382 #[doc = "Horizontal image resolution. Use 0 if not known."]
7383 pub resolution_h: u16,
7384 #[doc = "Vertical image resolution. Use 0 if not known."]
7385 pub resolution_v: u16,
7386 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7387 pub cam_definition_version: u16,
7388 #[doc = "Name of the camera vendor"]
7389 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7390 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7391 pub vendor_name: [u8; 32],
7392 #[doc = "Name of the camera model"]
7393 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7394 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7395 pub model_name: [u8; 32],
7396 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7397 pub lens_id: u8,
7398 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7399 #[cfg_attr(feature = "ts", ts(type = "string"))]
7400 pub cam_definition_uri: CharArray<140>,
7401 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7402 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7403 pub gimbal_device_id: u8,
7404 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7405 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7406 pub camera_device_id: u8,
7407}
7408impl CAMERA_INFORMATION_DATA {
7409 pub const ENCODED_LEN: usize = 237usize;
7410 pub const DEFAULT: Self = Self {
7411 time_boot_ms: 0_u32,
7412 firmware_version: 0_u32,
7413 focal_length: 0.0_f32,
7414 sensor_size_h: 0.0_f32,
7415 sensor_size_v: 0.0_f32,
7416 flags: CameraCapFlags::DEFAULT,
7417 resolution_h: 0_u16,
7418 resolution_v: 0_u16,
7419 cam_definition_version: 0_u16,
7420 vendor_name: [0_u8; 32usize],
7421 model_name: [0_u8; 32usize],
7422 lens_id: 0_u8,
7423 cam_definition_uri: CharArray::new([0_u8; 140usize]),
7424 gimbal_device_id: 0_u8,
7425 camera_device_id: 0_u8,
7426 };
7427 #[cfg(feature = "arbitrary")]
7428 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7429 use arbitrary::{Arbitrary, Unstructured};
7430 let mut buf = [0u8; 1024];
7431 rng.fill_bytes(&mut buf);
7432 let mut unstructured = Unstructured::new(&buf);
7433 Self::arbitrary(&mut unstructured).unwrap_or_default()
7434 }
7435}
7436impl Default for CAMERA_INFORMATION_DATA {
7437 fn default() -> Self {
7438 Self::DEFAULT.clone()
7439 }
7440}
7441impl MessageData for CAMERA_INFORMATION_DATA {
7442 type Message = MavMessage;
7443 const ID: u32 = 259u32;
7444 const NAME: &'static str = "CAMERA_INFORMATION";
7445 const EXTRA_CRC: u8 = 92u8;
7446 const ENCODED_LEN: usize = 237usize;
7447 fn deser(
7448 _version: MavlinkVersion,
7449 __input: &[u8],
7450 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7451 let avail_len = __input.len();
7452 let mut payload_buf = [0; Self::ENCODED_LEN];
7453 let mut buf = if avail_len < Self::ENCODED_LEN {
7454 payload_buf[0..avail_len].copy_from_slice(__input);
7455 Bytes::new(&payload_buf)
7456 } else {
7457 Bytes::new(__input)
7458 };
7459 let mut __struct = Self::default();
7460 __struct.time_boot_ms = buf.get_u32_le();
7461 __struct.firmware_version = buf.get_u32_le();
7462 __struct.focal_length = buf.get_f32_le();
7463 __struct.sensor_size_h = buf.get_f32_le();
7464 __struct.sensor_size_v = buf.get_f32_le();
7465 let tmp = buf.get_u32_le();
7466 __struct.flags = CameraCapFlags::from_bits(tmp as <CameraCapFlags as Flags>::Bits).ok_or(
7467 ::mavlink_core::error::ParserError::InvalidFlag {
7468 flag_type: "CameraCapFlags",
7469 value: tmp as u64,
7470 },
7471 )?;
7472 __struct.resolution_h = buf.get_u16_le();
7473 __struct.resolution_v = buf.get_u16_le();
7474 __struct.cam_definition_version = buf.get_u16_le();
7475 for v in &mut __struct.vendor_name {
7476 let val = buf.get_u8();
7477 *v = val;
7478 }
7479 for v in &mut __struct.model_name {
7480 let val = buf.get_u8();
7481 *v = val;
7482 }
7483 __struct.lens_id = buf.get_u8();
7484 let mut tmp = [0_u8; 140usize];
7485 for v in &mut tmp {
7486 *v = buf.get_u8();
7487 }
7488 __struct.cam_definition_uri = CharArray::new(tmp);
7489 __struct.gimbal_device_id = buf.get_u8();
7490 __struct.camera_device_id = buf.get_u8();
7491 Ok(__struct)
7492 }
7493 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7494 let mut __tmp = BytesMut::new(bytes);
7495 #[allow(clippy::absurd_extreme_comparisons)]
7496 #[allow(unused_comparisons)]
7497 if __tmp.remaining() < Self::ENCODED_LEN {
7498 panic!(
7499 "buffer is too small (need {} bytes, but got {})",
7500 Self::ENCODED_LEN,
7501 __tmp.remaining(),
7502 )
7503 }
7504 __tmp.put_u32_le(self.time_boot_ms);
7505 __tmp.put_u32_le(self.firmware_version);
7506 __tmp.put_f32_le(self.focal_length);
7507 __tmp.put_f32_le(self.sensor_size_h);
7508 __tmp.put_f32_le(self.sensor_size_v);
7509 __tmp.put_u32_le(self.flags.bits() as u32);
7510 __tmp.put_u16_le(self.resolution_h);
7511 __tmp.put_u16_le(self.resolution_v);
7512 __tmp.put_u16_le(self.cam_definition_version);
7513 for val in &self.vendor_name {
7514 __tmp.put_u8(*val);
7515 }
7516 for val in &self.model_name {
7517 __tmp.put_u8(*val);
7518 }
7519 __tmp.put_u8(self.lens_id);
7520 for val in &self.cam_definition_uri {
7521 __tmp.put_u8(*val);
7522 }
7523 if matches!(version, MavlinkVersion::V2) {
7524 __tmp.put_u8(self.gimbal_device_id);
7525 __tmp.put_u8(self.camera_device_id);
7526 let len = __tmp.len();
7527 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7528 } else {
7529 __tmp.len()
7530 }
7531 }
7532}
7533#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7534#[doc = ""]
7535#[doc = "ID: 260"]
7536#[derive(Debug, Clone, PartialEq)]
7537#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7538#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7539#[cfg_attr(feature = "ts", derive(TS))]
7540#[cfg_attr(feature = "ts", ts(export))]
7541pub struct CAMERA_SETTINGS_DATA {
7542 #[doc = "Timestamp (time since system boot)."]
7543 pub time_boot_ms: u32,
7544 #[doc = "Camera mode"]
7545 pub mode_id: CameraMode,
7546 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7547 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7548 pub zoomLevel: f32,
7549 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7550 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7551 pub focusLevel: f32,
7552 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7553 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7554 pub camera_device_id: u8,
7555}
7556impl CAMERA_SETTINGS_DATA {
7557 pub const ENCODED_LEN: usize = 14usize;
7558 pub const DEFAULT: Self = Self {
7559 time_boot_ms: 0_u32,
7560 mode_id: CameraMode::DEFAULT,
7561 zoomLevel: 0.0_f32,
7562 focusLevel: 0.0_f32,
7563 camera_device_id: 0_u8,
7564 };
7565 #[cfg(feature = "arbitrary")]
7566 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7567 use arbitrary::{Arbitrary, Unstructured};
7568 let mut buf = [0u8; 1024];
7569 rng.fill_bytes(&mut buf);
7570 let mut unstructured = Unstructured::new(&buf);
7571 Self::arbitrary(&mut unstructured).unwrap_or_default()
7572 }
7573}
7574impl Default for CAMERA_SETTINGS_DATA {
7575 fn default() -> Self {
7576 Self::DEFAULT.clone()
7577 }
7578}
7579impl MessageData for CAMERA_SETTINGS_DATA {
7580 type Message = MavMessage;
7581 const ID: u32 = 260u32;
7582 const NAME: &'static str = "CAMERA_SETTINGS";
7583 const EXTRA_CRC: u8 = 146u8;
7584 const ENCODED_LEN: usize = 14usize;
7585 fn deser(
7586 _version: MavlinkVersion,
7587 __input: &[u8],
7588 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7589 let avail_len = __input.len();
7590 let mut payload_buf = [0; Self::ENCODED_LEN];
7591 let mut buf = if avail_len < Self::ENCODED_LEN {
7592 payload_buf[0..avail_len].copy_from_slice(__input);
7593 Bytes::new(&payload_buf)
7594 } else {
7595 Bytes::new(__input)
7596 };
7597 let mut __struct = Self::default();
7598 __struct.time_boot_ms = buf.get_u32_le();
7599 let tmp = buf.get_u8();
7600 __struct.mode_id =
7601 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7602 enum_type: "CameraMode",
7603 value: tmp as u64,
7604 })?;
7605 __struct.zoomLevel = buf.get_f32_le();
7606 __struct.focusLevel = buf.get_f32_le();
7607 __struct.camera_device_id = buf.get_u8();
7608 Ok(__struct)
7609 }
7610 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7611 let mut __tmp = BytesMut::new(bytes);
7612 #[allow(clippy::absurd_extreme_comparisons)]
7613 #[allow(unused_comparisons)]
7614 if __tmp.remaining() < Self::ENCODED_LEN {
7615 panic!(
7616 "buffer is too small (need {} bytes, but got {})",
7617 Self::ENCODED_LEN,
7618 __tmp.remaining(),
7619 )
7620 }
7621 __tmp.put_u32_le(self.time_boot_ms);
7622 __tmp.put_u8(self.mode_id as u8);
7623 if matches!(version, MavlinkVersion::V2) {
7624 __tmp.put_f32_le(self.zoomLevel);
7625 __tmp.put_f32_le(self.focusLevel);
7626 __tmp.put_u8(self.camera_device_id);
7627 let len = __tmp.len();
7628 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7629 } else {
7630 __tmp.len()
7631 }
7632 }
7633}
7634#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7635#[doc = ""]
7636#[doc = "ID: 277"]
7637#[derive(Debug, Clone, PartialEq)]
7638#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7639#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7640#[cfg_attr(feature = "ts", derive(TS))]
7641#[cfg_attr(feature = "ts", ts(export))]
7642pub struct CAMERA_THERMAL_RANGE_DATA {
7643 #[doc = "Timestamp (time since system boot)."]
7644 pub time_boot_ms: u32,
7645 #[doc = "Temperature max."]
7646 pub max: f32,
7647 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7648 pub max_point_x: f32,
7649 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7650 pub max_point_y: f32,
7651 #[doc = "Temperature min."]
7652 pub min: f32,
7653 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7654 pub min_point_x: f32,
7655 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7656 pub min_point_y: f32,
7657 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7658 pub stream_id: u8,
7659 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7660 pub camera_device_id: u8,
7661}
7662impl CAMERA_THERMAL_RANGE_DATA {
7663 pub const ENCODED_LEN: usize = 30usize;
7664 pub const DEFAULT: Self = Self {
7665 time_boot_ms: 0_u32,
7666 max: 0.0_f32,
7667 max_point_x: 0.0_f32,
7668 max_point_y: 0.0_f32,
7669 min: 0.0_f32,
7670 min_point_x: 0.0_f32,
7671 min_point_y: 0.0_f32,
7672 stream_id: 0_u8,
7673 camera_device_id: 0_u8,
7674 };
7675 #[cfg(feature = "arbitrary")]
7676 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7677 use arbitrary::{Arbitrary, Unstructured};
7678 let mut buf = [0u8; 1024];
7679 rng.fill_bytes(&mut buf);
7680 let mut unstructured = Unstructured::new(&buf);
7681 Self::arbitrary(&mut unstructured).unwrap_or_default()
7682 }
7683}
7684impl Default for CAMERA_THERMAL_RANGE_DATA {
7685 fn default() -> Self {
7686 Self::DEFAULT.clone()
7687 }
7688}
7689impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7690 type Message = MavMessage;
7691 const ID: u32 = 277u32;
7692 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7693 const EXTRA_CRC: u8 = 62u8;
7694 const ENCODED_LEN: usize = 30usize;
7695 fn deser(
7696 _version: MavlinkVersion,
7697 __input: &[u8],
7698 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7699 let avail_len = __input.len();
7700 let mut payload_buf = [0; Self::ENCODED_LEN];
7701 let mut buf = if avail_len < Self::ENCODED_LEN {
7702 payload_buf[0..avail_len].copy_from_slice(__input);
7703 Bytes::new(&payload_buf)
7704 } else {
7705 Bytes::new(__input)
7706 };
7707 let mut __struct = Self::default();
7708 __struct.time_boot_ms = buf.get_u32_le();
7709 __struct.max = buf.get_f32_le();
7710 __struct.max_point_x = buf.get_f32_le();
7711 __struct.max_point_y = buf.get_f32_le();
7712 __struct.min = buf.get_f32_le();
7713 __struct.min_point_x = buf.get_f32_le();
7714 __struct.min_point_y = buf.get_f32_le();
7715 __struct.stream_id = buf.get_u8();
7716 __struct.camera_device_id = buf.get_u8();
7717 Ok(__struct)
7718 }
7719 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7720 let mut __tmp = BytesMut::new(bytes);
7721 #[allow(clippy::absurd_extreme_comparisons)]
7722 #[allow(unused_comparisons)]
7723 if __tmp.remaining() < Self::ENCODED_LEN {
7724 panic!(
7725 "buffer is too small (need {} bytes, but got {})",
7726 Self::ENCODED_LEN,
7727 __tmp.remaining(),
7728 )
7729 }
7730 __tmp.put_u32_le(self.time_boot_ms);
7731 __tmp.put_f32_le(self.max);
7732 __tmp.put_f32_le(self.max_point_x);
7733 __tmp.put_f32_le(self.max_point_y);
7734 __tmp.put_f32_le(self.min);
7735 __tmp.put_f32_le(self.min_point_x);
7736 __tmp.put_f32_le(self.min_point_y);
7737 __tmp.put_u8(self.stream_id);
7738 __tmp.put_u8(self.camera_device_id);
7739 if matches!(version, MavlinkVersion::V2) {
7740 let len = __tmp.len();
7741 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7742 } else {
7743 __tmp.len()
7744 }
7745 }
7746}
7747#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7748#[doc = ""]
7749#[doc = "ID: 276"]
7750#[derive(Debug, Clone, PartialEq)]
7751#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7752#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7753#[cfg_attr(feature = "ts", derive(TS))]
7754#[cfg_attr(feature = "ts", ts(export))]
7755pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7756 #[doc = "Latitude of tracked object"]
7757 pub lat: i32,
7758 #[doc = "Longitude of tracked object"]
7759 pub lon: i32,
7760 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7761 pub alt: f32,
7762 #[doc = "Horizontal accuracy. NAN if unknown"]
7763 pub h_acc: f32,
7764 #[doc = "Vertical accuracy. NAN if unknown"]
7765 pub v_acc: f32,
7766 #[doc = "North velocity of tracked object. NAN if unknown"]
7767 pub vel_n: f32,
7768 #[doc = "East velocity of tracked object. NAN if unknown"]
7769 pub vel_e: f32,
7770 #[doc = "Down velocity of tracked object. NAN if unknown"]
7771 pub vel_d: f32,
7772 #[doc = "Velocity accuracy. NAN if unknown"]
7773 pub vel_acc: f32,
7774 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7775 pub dist: f32,
7776 #[doc = "Heading in radians, in NED. NAN if unknown"]
7777 pub hdg: f32,
7778 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7779 pub hdg_acc: f32,
7780 #[doc = "Current tracking status"]
7781 pub tracking_status: CameraTrackingStatusFlags,
7782 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7783 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7784 pub camera_device_id: u8,
7785}
7786impl CAMERA_TRACKING_GEO_STATUS_DATA {
7787 pub const ENCODED_LEN: usize = 50usize;
7788 pub const DEFAULT: Self = Self {
7789 lat: 0_i32,
7790 lon: 0_i32,
7791 alt: 0.0_f32,
7792 h_acc: 0.0_f32,
7793 v_acc: 0.0_f32,
7794 vel_n: 0.0_f32,
7795 vel_e: 0.0_f32,
7796 vel_d: 0.0_f32,
7797 vel_acc: 0.0_f32,
7798 dist: 0.0_f32,
7799 hdg: 0.0_f32,
7800 hdg_acc: 0.0_f32,
7801 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7802 camera_device_id: 0_u8,
7803 };
7804 #[cfg(feature = "arbitrary")]
7805 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7806 use arbitrary::{Arbitrary, Unstructured};
7807 let mut buf = [0u8; 1024];
7808 rng.fill_bytes(&mut buf);
7809 let mut unstructured = Unstructured::new(&buf);
7810 Self::arbitrary(&mut unstructured).unwrap_or_default()
7811 }
7812}
7813impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7814 fn default() -> Self {
7815 Self::DEFAULT.clone()
7816 }
7817}
7818impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7819 type Message = MavMessage;
7820 const ID: u32 = 276u32;
7821 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7822 const EXTRA_CRC: u8 = 18u8;
7823 const ENCODED_LEN: usize = 50usize;
7824 fn deser(
7825 _version: MavlinkVersion,
7826 __input: &[u8],
7827 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7828 let avail_len = __input.len();
7829 let mut payload_buf = [0; Self::ENCODED_LEN];
7830 let mut buf = if avail_len < Self::ENCODED_LEN {
7831 payload_buf[0..avail_len].copy_from_slice(__input);
7832 Bytes::new(&payload_buf)
7833 } else {
7834 Bytes::new(__input)
7835 };
7836 let mut __struct = Self::default();
7837 __struct.lat = buf.get_i32_le();
7838 __struct.lon = buf.get_i32_le();
7839 __struct.alt = buf.get_f32_le();
7840 __struct.h_acc = buf.get_f32_le();
7841 __struct.v_acc = buf.get_f32_le();
7842 __struct.vel_n = buf.get_f32_le();
7843 __struct.vel_e = buf.get_f32_le();
7844 __struct.vel_d = buf.get_f32_le();
7845 __struct.vel_acc = buf.get_f32_le();
7846 __struct.dist = buf.get_f32_le();
7847 __struct.hdg = buf.get_f32_le();
7848 __struct.hdg_acc = buf.get_f32_le();
7849 let tmp = buf.get_u8();
7850 __struct.tracking_status =
7851 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7852 enum_type: "CameraTrackingStatusFlags",
7853 value: tmp as u64,
7854 })?;
7855 __struct.camera_device_id = buf.get_u8();
7856 Ok(__struct)
7857 }
7858 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7859 let mut __tmp = BytesMut::new(bytes);
7860 #[allow(clippy::absurd_extreme_comparisons)]
7861 #[allow(unused_comparisons)]
7862 if __tmp.remaining() < Self::ENCODED_LEN {
7863 panic!(
7864 "buffer is too small (need {} bytes, but got {})",
7865 Self::ENCODED_LEN,
7866 __tmp.remaining(),
7867 )
7868 }
7869 __tmp.put_i32_le(self.lat);
7870 __tmp.put_i32_le(self.lon);
7871 __tmp.put_f32_le(self.alt);
7872 __tmp.put_f32_le(self.h_acc);
7873 __tmp.put_f32_le(self.v_acc);
7874 __tmp.put_f32_le(self.vel_n);
7875 __tmp.put_f32_le(self.vel_e);
7876 __tmp.put_f32_le(self.vel_d);
7877 __tmp.put_f32_le(self.vel_acc);
7878 __tmp.put_f32_le(self.dist);
7879 __tmp.put_f32_le(self.hdg);
7880 __tmp.put_f32_le(self.hdg_acc);
7881 __tmp.put_u8(self.tracking_status as u8);
7882 if matches!(version, MavlinkVersion::V2) {
7883 __tmp.put_u8(self.camera_device_id);
7884 let len = __tmp.len();
7885 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7886 } else {
7887 __tmp.len()
7888 }
7889 }
7890}
7891#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7892#[doc = ""]
7893#[doc = "ID: 275"]
7894#[derive(Debug, Clone, PartialEq)]
7895#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7896#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7897#[cfg_attr(feature = "ts", derive(TS))]
7898#[cfg_attr(feature = "ts", ts(export))]
7899pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7900 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7901 pub point_x: f32,
7902 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7903 pub point_y: f32,
7904 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7905 pub radius: f32,
7906 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7907 pub rec_top_x: f32,
7908 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7909 pub rec_top_y: f32,
7910 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7911 pub rec_bottom_x: f32,
7912 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7913 pub rec_bottom_y: f32,
7914 #[doc = "Current tracking status"]
7915 pub tracking_status: CameraTrackingStatusFlags,
7916 #[doc = "Current tracking mode"]
7917 pub tracking_mode: CameraTrackingMode,
7918 #[doc = "Defines location of target data"]
7919 pub target_data: CameraTrackingTargetData,
7920 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7921 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7922 pub camera_device_id: u8,
7923}
7924impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7925 pub const ENCODED_LEN: usize = 32usize;
7926 pub const DEFAULT: Self = Self {
7927 point_x: 0.0_f32,
7928 point_y: 0.0_f32,
7929 radius: 0.0_f32,
7930 rec_top_x: 0.0_f32,
7931 rec_top_y: 0.0_f32,
7932 rec_bottom_x: 0.0_f32,
7933 rec_bottom_y: 0.0_f32,
7934 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7935 tracking_mode: CameraTrackingMode::DEFAULT,
7936 target_data: CameraTrackingTargetData::DEFAULT,
7937 camera_device_id: 0_u8,
7938 };
7939 #[cfg(feature = "arbitrary")]
7940 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7941 use arbitrary::{Arbitrary, Unstructured};
7942 let mut buf = [0u8; 1024];
7943 rng.fill_bytes(&mut buf);
7944 let mut unstructured = Unstructured::new(&buf);
7945 Self::arbitrary(&mut unstructured).unwrap_or_default()
7946 }
7947}
7948impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7949 fn default() -> Self {
7950 Self::DEFAULT.clone()
7951 }
7952}
7953impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7954 type Message = MavMessage;
7955 const ID: u32 = 275u32;
7956 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
7957 const EXTRA_CRC: u8 = 126u8;
7958 const ENCODED_LEN: usize = 32usize;
7959 fn deser(
7960 _version: MavlinkVersion,
7961 __input: &[u8],
7962 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7963 let avail_len = __input.len();
7964 let mut payload_buf = [0; Self::ENCODED_LEN];
7965 let mut buf = if avail_len < Self::ENCODED_LEN {
7966 payload_buf[0..avail_len].copy_from_slice(__input);
7967 Bytes::new(&payload_buf)
7968 } else {
7969 Bytes::new(__input)
7970 };
7971 let mut __struct = Self::default();
7972 __struct.point_x = buf.get_f32_le();
7973 __struct.point_y = buf.get_f32_le();
7974 __struct.radius = buf.get_f32_le();
7975 __struct.rec_top_x = buf.get_f32_le();
7976 __struct.rec_top_y = buf.get_f32_le();
7977 __struct.rec_bottom_x = buf.get_f32_le();
7978 __struct.rec_bottom_y = buf.get_f32_le();
7979 let tmp = buf.get_u8();
7980 __struct.tracking_status =
7981 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7982 enum_type: "CameraTrackingStatusFlags",
7983 value: tmp as u64,
7984 })?;
7985 let tmp = buf.get_u8();
7986 __struct.tracking_mode =
7987 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7988 enum_type: "CameraTrackingMode",
7989 value: tmp as u64,
7990 })?;
7991 let tmp = buf.get_u8();
7992 __struct.target_data =
7993 CameraTrackingTargetData::from_bits(tmp as <CameraTrackingTargetData as Flags>::Bits)
7994 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7995 flag_type: "CameraTrackingTargetData",
7996 value: tmp as u64,
7997 })?;
7998 __struct.camera_device_id = buf.get_u8();
7999 Ok(__struct)
8000 }
8001 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8002 let mut __tmp = BytesMut::new(bytes);
8003 #[allow(clippy::absurd_extreme_comparisons)]
8004 #[allow(unused_comparisons)]
8005 if __tmp.remaining() < Self::ENCODED_LEN {
8006 panic!(
8007 "buffer is too small (need {} bytes, but got {})",
8008 Self::ENCODED_LEN,
8009 __tmp.remaining(),
8010 )
8011 }
8012 __tmp.put_f32_le(self.point_x);
8013 __tmp.put_f32_le(self.point_y);
8014 __tmp.put_f32_le(self.radius);
8015 __tmp.put_f32_le(self.rec_top_x);
8016 __tmp.put_f32_le(self.rec_top_y);
8017 __tmp.put_f32_le(self.rec_bottom_x);
8018 __tmp.put_f32_le(self.rec_bottom_y);
8019 __tmp.put_u8(self.tracking_status as u8);
8020 __tmp.put_u8(self.tracking_mode as u8);
8021 __tmp.put_u8(self.target_data.bits() as u8);
8022 if matches!(version, MavlinkVersion::V2) {
8023 __tmp.put_u8(self.camera_device_id);
8024 let len = __tmp.len();
8025 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8026 } else {
8027 __tmp.len()
8028 }
8029 }
8030}
8031#[doc = "Camera-IMU triggering and synchronisation message."]
8032#[doc = ""]
8033#[doc = "ID: 112"]
8034#[derive(Debug, Clone, PartialEq)]
8035#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8037#[cfg_attr(feature = "ts", derive(TS))]
8038#[cfg_attr(feature = "ts", ts(export))]
8039pub struct CAMERA_TRIGGER_DATA {
8040 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8041 pub time_usec: u64,
8042 #[doc = "Image frame sequence"]
8043 pub seq: u32,
8044}
8045impl CAMERA_TRIGGER_DATA {
8046 pub const ENCODED_LEN: usize = 12usize;
8047 pub const DEFAULT: Self = Self {
8048 time_usec: 0_u64,
8049 seq: 0_u32,
8050 };
8051 #[cfg(feature = "arbitrary")]
8052 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8053 use arbitrary::{Arbitrary, Unstructured};
8054 let mut buf = [0u8; 1024];
8055 rng.fill_bytes(&mut buf);
8056 let mut unstructured = Unstructured::new(&buf);
8057 Self::arbitrary(&mut unstructured).unwrap_or_default()
8058 }
8059}
8060impl Default for CAMERA_TRIGGER_DATA {
8061 fn default() -> Self {
8062 Self::DEFAULT.clone()
8063 }
8064}
8065impl MessageData for CAMERA_TRIGGER_DATA {
8066 type Message = MavMessage;
8067 const ID: u32 = 112u32;
8068 const NAME: &'static str = "CAMERA_TRIGGER";
8069 const EXTRA_CRC: u8 = 174u8;
8070 const ENCODED_LEN: usize = 12usize;
8071 fn deser(
8072 _version: MavlinkVersion,
8073 __input: &[u8],
8074 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8075 let avail_len = __input.len();
8076 let mut payload_buf = [0; Self::ENCODED_LEN];
8077 let mut buf = if avail_len < Self::ENCODED_LEN {
8078 payload_buf[0..avail_len].copy_from_slice(__input);
8079 Bytes::new(&payload_buf)
8080 } else {
8081 Bytes::new(__input)
8082 };
8083 let mut __struct = Self::default();
8084 __struct.time_usec = buf.get_u64_le();
8085 __struct.seq = buf.get_u32_le();
8086 Ok(__struct)
8087 }
8088 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8089 let mut __tmp = BytesMut::new(bytes);
8090 #[allow(clippy::absurd_extreme_comparisons)]
8091 #[allow(unused_comparisons)]
8092 if __tmp.remaining() < Self::ENCODED_LEN {
8093 panic!(
8094 "buffer is too small (need {} bytes, but got {})",
8095 Self::ENCODED_LEN,
8096 __tmp.remaining(),
8097 )
8098 }
8099 __tmp.put_u64_le(self.time_usec);
8100 __tmp.put_u32_le(self.seq);
8101 if matches!(version, MavlinkVersion::V2) {
8102 let len = __tmp.len();
8103 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8104 } else {
8105 __tmp.len()
8106 }
8107 }
8108}
8109#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8110#[doc = ""]
8111#[doc = "ID: 387"]
8112#[derive(Debug, Clone, PartialEq)]
8113#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8114#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8115#[cfg_attr(feature = "ts", derive(TS))]
8116#[cfg_attr(feature = "ts", ts(export))]
8117pub struct CANFD_FRAME_DATA {
8118 #[doc = "Frame ID"]
8119 pub id: u32,
8120 #[doc = "System ID."]
8121 pub target_system: u8,
8122 #[doc = "Component ID."]
8123 pub target_component: u8,
8124 #[doc = "bus number"]
8125 pub bus: u8,
8126 #[doc = "Frame length"]
8127 pub len: u8,
8128 #[doc = "Frame data"]
8129 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8130 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8131 pub data: [u8; 64],
8132}
8133impl CANFD_FRAME_DATA {
8134 pub const ENCODED_LEN: usize = 72usize;
8135 pub const DEFAULT: Self = Self {
8136 id: 0_u32,
8137 target_system: 0_u8,
8138 target_component: 0_u8,
8139 bus: 0_u8,
8140 len: 0_u8,
8141 data: [0_u8; 64usize],
8142 };
8143 #[cfg(feature = "arbitrary")]
8144 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8145 use arbitrary::{Arbitrary, Unstructured};
8146 let mut buf = [0u8; 1024];
8147 rng.fill_bytes(&mut buf);
8148 let mut unstructured = Unstructured::new(&buf);
8149 Self::arbitrary(&mut unstructured).unwrap_or_default()
8150 }
8151}
8152impl Default for CANFD_FRAME_DATA {
8153 fn default() -> Self {
8154 Self::DEFAULT.clone()
8155 }
8156}
8157impl MessageData for CANFD_FRAME_DATA {
8158 type Message = MavMessage;
8159 const ID: u32 = 387u32;
8160 const NAME: &'static str = "CANFD_FRAME";
8161 const EXTRA_CRC: u8 = 4u8;
8162 const ENCODED_LEN: usize = 72usize;
8163 fn deser(
8164 _version: MavlinkVersion,
8165 __input: &[u8],
8166 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8167 let avail_len = __input.len();
8168 let mut payload_buf = [0; Self::ENCODED_LEN];
8169 let mut buf = if avail_len < Self::ENCODED_LEN {
8170 payload_buf[0..avail_len].copy_from_slice(__input);
8171 Bytes::new(&payload_buf)
8172 } else {
8173 Bytes::new(__input)
8174 };
8175 let mut __struct = Self::default();
8176 __struct.id = buf.get_u32_le();
8177 __struct.target_system = buf.get_u8();
8178 __struct.target_component = buf.get_u8();
8179 __struct.bus = buf.get_u8();
8180 __struct.len = buf.get_u8();
8181 for v in &mut __struct.data {
8182 let val = buf.get_u8();
8183 *v = val;
8184 }
8185 Ok(__struct)
8186 }
8187 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8188 let mut __tmp = BytesMut::new(bytes);
8189 #[allow(clippy::absurd_extreme_comparisons)]
8190 #[allow(unused_comparisons)]
8191 if __tmp.remaining() < Self::ENCODED_LEN {
8192 panic!(
8193 "buffer is too small (need {} bytes, but got {})",
8194 Self::ENCODED_LEN,
8195 __tmp.remaining(),
8196 )
8197 }
8198 __tmp.put_u32_le(self.id);
8199 __tmp.put_u8(self.target_system);
8200 __tmp.put_u8(self.target_component);
8201 __tmp.put_u8(self.bus);
8202 __tmp.put_u8(self.len);
8203 for val in &self.data {
8204 __tmp.put_u8(*val);
8205 }
8206 if matches!(version, MavlinkVersion::V2) {
8207 let len = __tmp.len();
8208 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8209 } else {
8210 __tmp.len()
8211 }
8212 }
8213}
8214#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8215#[doc = ""]
8216#[doc = "ID: 388"]
8217#[derive(Debug, Clone, PartialEq)]
8218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8219#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8220#[cfg_attr(feature = "ts", derive(TS))]
8221#[cfg_attr(feature = "ts", ts(export))]
8222pub struct CAN_FILTER_MODIFY_DATA {
8223 #[doc = "filter IDs, length num_ids"]
8224 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8225 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8226 pub ids: [u16; 16],
8227 #[doc = "System ID."]
8228 pub target_system: u8,
8229 #[doc = "Component ID."]
8230 pub target_component: u8,
8231 #[doc = "bus number"]
8232 pub bus: u8,
8233 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8234 pub operation: CanFilterOp,
8235 #[doc = "number of IDs in filter list"]
8236 pub num_ids: u8,
8237}
8238impl CAN_FILTER_MODIFY_DATA {
8239 pub const ENCODED_LEN: usize = 37usize;
8240 pub const DEFAULT: Self = Self {
8241 ids: [0_u16; 16usize],
8242 target_system: 0_u8,
8243 target_component: 0_u8,
8244 bus: 0_u8,
8245 operation: CanFilterOp::DEFAULT,
8246 num_ids: 0_u8,
8247 };
8248 #[cfg(feature = "arbitrary")]
8249 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8250 use arbitrary::{Arbitrary, Unstructured};
8251 let mut buf = [0u8; 1024];
8252 rng.fill_bytes(&mut buf);
8253 let mut unstructured = Unstructured::new(&buf);
8254 Self::arbitrary(&mut unstructured).unwrap_or_default()
8255 }
8256}
8257impl Default for CAN_FILTER_MODIFY_DATA {
8258 fn default() -> Self {
8259 Self::DEFAULT.clone()
8260 }
8261}
8262impl MessageData for CAN_FILTER_MODIFY_DATA {
8263 type Message = MavMessage;
8264 const ID: u32 = 388u32;
8265 const NAME: &'static str = "CAN_FILTER_MODIFY";
8266 const EXTRA_CRC: u8 = 8u8;
8267 const ENCODED_LEN: usize = 37usize;
8268 fn deser(
8269 _version: MavlinkVersion,
8270 __input: &[u8],
8271 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8272 let avail_len = __input.len();
8273 let mut payload_buf = [0; Self::ENCODED_LEN];
8274 let mut buf = if avail_len < Self::ENCODED_LEN {
8275 payload_buf[0..avail_len].copy_from_slice(__input);
8276 Bytes::new(&payload_buf)
8277 } else {
8278 Bytes::new(__input)
8279 };
8280 let mut __struct = Self::default();
8281 for v in &mut __struct.ids {
8282 let val = buf.get_u16_le();
8283 *v = val;
8284 }
8285 __struct.target_system = buf.get_u8();
8286 __struct.target_component = buf.get_u8();
8287 __struct.bus = buf.get_u8();
8288 let tmp = buf.get_u8();
8289 __struct.operation =
8290 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8291 enum_type: "CanFilterOp",
8292 value: tmp as u64,
8293 })?;
8294 __struct.num_ids = buf.get_u8();
8295 Ok(__struct)
8296 }
8297 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8298 let mut __tmp = BytesMut::new(bytes);
8299 #[allow(clippy::absurd_extreme_comparisons)]
8300 #[allow(unused_comparisons)]
8301 if __tmp.remaining() < Self::ENCODED_LEN {
8302 panic!(
8303 "buffer is too small (need {} bytes, but got {})",
8304 Self::ENCODED_LEN,
8305 __tmp.remaining(),
8306 )
8307 }
8308 for val in &self.ids {
8309 __tmp.put_u16_le(*val);
8310 }
8311 __tmp.put_u8(self.target_system);
8312 __tmp.put_u8(self.target_component);
8313 __tmp.put_u8(self.bus);
8314 __tmp.put_u8(self.operation as u8);
8315 __tmp.put_u8(self.num_ids);
8316 if matches!(version, MavlinkVersion::V2) {
8317 let len = __tmp.len();
8318 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8319 } else {
8320 __tmp.len()
8321 }
8322 }
8323}
8324#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8325#[doc = ""]
8326#[doc = "ID: 386"]
8327#[derive(Debug, Clone, PartialEq)]
8328#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8329#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8330#[cfg_attr(feature = "ts", derive(TS))]
8331#[cfg_attr(feature = "ts", ts(export))]
8332pub struct CAN_FRAME_DATA {
8333 #[doc = "Frame ID"]
8334 pub id: u32,
8335 #[doc = "System ID."]
8336 pub target_system: u8,
8337 #[doc = "Component ID."]
8338 pub target_component: u8,
8339 #[doc = "Bus number"]
8340 pub bus: u8,
8341 #[doc = "Frame length"]
8342 pub len: u8,
8343 #[doc = "Frame data"]
8344 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8345 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8346 pub data: [u8; 8],
8347}
8348impl CAN_FRAME_DATA {
8349 pub const ENCODED_LEN: usize = 16usize;
8350 pub const DEFAULT: Self = Self {
8351 id: 0_u32,
8352 target_system: 0_u8,
8353 target_component: 0_u8,
8354 bus: 0_u8,
8355 len: 0_u8,
8356 data: [0_u8; 8usize],
8357 };
8358 #[cfg(feature = "arbitrary")]
8359 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8360 use arbitrary::{Arbitrary, Unstructured};
8361 let mut buf = [0u8; 1024];
8362 rng.fill_bytes(&mut buf);
8363 let mut unstructured = Unstructured::new(&buf);
8364 Self::arbitrary(&mut unstructured).unwrap_or_default()
8365 }
8366}
8367impl Default for CAN_FRAME_DATA {
8368 fn default() -> Self {
8369 Self::DEFAULT.clone()
8370 }
8371}
8372impl MessageData for CAN_FRAME_DATA {
8373 type Message = MavMessage;
8374 const ID: u32 = 386u32;
8375 const NAME: &'static str = "CAN_FRAME";
8376 const EXTRA_CRC: u8 = 132u8;
8377 const ENCODED_LEN: usize = 16usize;
8378 fn deser(
8379 _version: MavlinkVersion,
8380 __input: &[u8],
8381 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8382 let avail_len = __input.len();
8383 let mut payload_buf = [0; Self::ENCODED_LEN];
8384 let mut buf = if avail_len < Self::ENCODED_LEN {
8385 payload_buf[0..avail_len].copy_from_slice(__input);
8386 Bytes::new(&payload_buf)
8387 } else {
8388 Bytes::new(__input)
8389 };
8390 let mut __struct = Self::default();
8391 __struct.id = buf.get_u32_le();
8392 __struct.target_system = buf.get_u8();
8393 __struct.target_component = buf.get_u8();
8394 __struct.bus = buf.get_u8();
8395 __struct.len = buf.get_u8();
8396 for v in &mut __struct.data {
8397 let val = buf.get_u8();
8398 *v = val;
8399 }
8400 Ok(__struct)
8401 }
8402 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8403 let mut __tmp = BytesMut::new(bytes);
8404 #[allow(clippy::absurd_extreme_comparisons)]
8405 #[allow(unused_comparisons)]
8406 if __tmp.remaining() < Self::ENCODED_LEN {
8407 panic!(
8408 "buffer is too small (need {} bytes, but got {})",
8409 Self::ENCODED_LEN,
8410 __tmp.remaining(),
8411 )
8412 }
8413 __tmp.put_u32_le(self.id);
8414 __tmp.put_u8(self.target_system);
8415 __tmp.put_u8(self.target_component);
8416 __tmp.put_u8(self.bus);
8417 __tmp.put_u8(self.len);
8418 for val in &self.data {
8419 __tmp.put_u8(*val);
8420 }
8421 if matches!(version, MavlinkVersion::V2) {
8422 let len = __tmp.len();
8423 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8424 } else {
8425 __tmp.len()
8426 }
8427 }
8428}
8429#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8430#[doc = ""]
8431#[doc = "ID: 336"]
8432#[derive(Debug, Clone, PartialEq)]
8433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8435#[cfg_attr(feature = "ts", derive(TS))]
8436#[cfg_attr(feature = "ts", ts(export))]
8437pub struct CELLULAR_CONFIG_DATA {
8438 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8439 pub enable_lte: u8,
8440 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8441 pub enable_pin: u8,
8442 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8443 #[cfg_attr(feature = "ts", ts(type = "string"))]
8444 pub pin: CharArray<16>,
8445 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8446 #[cfg_attr(feature = "ts", ts(type = "string"))]
8447 pub new_pin: CharArray<16>,
8448 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8449 #[cfg_attr(feature = "ts", ts(type = "string"))]
8450 pub apn: CharArray<32>,
8451 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8452 #[cfg_attr(feature = "ts", ts(type = "string"))]
8453 pub puk: CharArray<16>,
8454 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8455 pub roaming: u8,
8456 #[doc = "Message acceptance response (sent back to GS)."]
8457 pub response: CellularConfigResponse,
8458}
8459impl CELLULAR_CONFIG_DATA {
8460 pub const ENCODED_LEN: usize = 84usize;
8461 pub const DEFAULT: Self = Self {
8462 enable_lte: 0_u8,
8463 enable_pin: 0_u8,
8464 pin: CharArray::new([0_u8; 16usize]),
8465 new_pin: CharArray::new([0_u8; 16usize]),
8466 apn: CharArray::new([0_u8; 32usize]),
8467 puk: CharArray::new([0_u8; 16usize]),
8468 roaming: 0_u8,
8469 response: CellularConfigResponse::DEFAULT,
8470 };
8471 #[cfg(feature = "arbitrary")]
8472 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8473 use arbitrary::{Arbitrary, Unstructured};
8474 let mut buf = [0u8; 1024];
8475 rng.fill_bytes(&mut buf);
8476 let mut unstructured = Unstructured::new(&buf);
8477 Self::arbitrary(&mut unstructured).unwrap_or_default()
8478 }
8479}
8480impl Default for CELLULAR_CONFIG_DATA {
8481 fn default() -> Self {
8482 Self::DEFAULT.clone()
8483 }
8484}
8485impl MessageData for CELLULAR_CONFIG_DATA {
8486 type Message = MavMessage;
8487 const ID: u32 = 336u32;
8488 const NAME: &'static str = "CELLULAR_CONFIG";
8489 const EXTRA_CRC: u8 = 245u8;
8490 const ENCODED_LEN: usize = 84usize;
8491 fn deser(
8492 _version: MavlinkVersion,
8493 __input: &[u8],
8494 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8495 let avail_len = __input.len();
8496 let mut payload_buf = [0; Self::ENCODED_LEN];
8497 let mut buf = if avail_len < Self::ENCODED_LEN {
8498 payload_buf[0..avail_len].copy_from_slice(__input);
8499 Bytes::new(&payload_buf)
8500 } else {
8501 Bytes::new(__input)
8502 };
8503 let mut __struct = Self::default();
8504 __struct.enable_lte = buf.get_u8();
8505 __struct.enable_pin = buf.get_u8();
8506 let mut tmp = [0_u8; 16usize];
8507 for v in &mut tmp {
8508 *v = buf.get_u8();
8509 }
8510 __struct.pin = CharArray::new(tmp);
8511 let mut tmp = [0_u8; 16usize];
8512 for v in &mut tmp {
8513 *v = buf.get_u8();
8514 }
8515 __struct.new_pin = CharArray::new(tmp);
8516 let mut tmp = [0_u8; 32usize];
8517 for v in &mut tmp {
8518 *v = buf.get_u8();
8519 }
8520 __struct.apn = CharArray::new(tmp);
8521 let mut tmp = [0_u8; 16usize];
8522 for v in &mut tmp {
8523 *v = buf.get_u8();
8524 }
8525 __struct.puk = CharArray::new(tmp);
8526 __struct.roaming = buf.get_u8();
8527 let tmp = buf.get_u8();
8528 __struct.response =
8529 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8530 enum_type: "CellularConfigResponse",
8531 value: tmp as u64,
8532 })?;
8533 Ok(__struct)
8534 }
8535 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8536 let mut __tmp = BytesMut::new(bytes);
8537 #[allow(clippy::absurd_extreme_comparisons)]
8538 #[allow(unused_comparisons)]
8539 if __tmp.remaining() < Self::ENCODED_LEN {
8540 panic!(
8541 "buffer is too small (need {} bytes, but got {})",
8542 Self::ENCODED_LEN,
8543 __tmp.remaining(),
8544 )
8545 }
8546 __tmp.put_u8(self.enable_lte);
8547 __tmp.put_u8(self.enable_pin);
8548 for val in &self.pin {
8549 __tmp.put_u8(*val);
8550 }
8551 for val in &self.new_pin {
8552 __tmp.put_u8(*val);
8553 }
8554 for val in &self.apn {
8555 __tmp.put_u8(*val);
8556 }
8557 for val in &self.puk {
8558 __tmp.put_u8(*val);
8559 }
8560 __tmp.put_u8(self.roaming);
8561 __tmp.put_u8(self.response as u8);
8562 if matches!(version, MavlinkVersion::V2) {
8563 let len = __tmp.len();
8564 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8565 } else {
8566 __tmp.len()
8567 }
8568 }
8569}
8570#[doc = "Report current used cellular network status."]
8571#[doc = ""]
8572#[doc = "ID: 334"]
8573#[derive(Debug, Clone, PartialEq)]
8574#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8575#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8576#[cfg_attr(feature = "ts", derive(TS))]
8577#[cfg_attr(feature = "ts", ts(export))]
8578pub struct CELLULAR_STATUS_DATA {
8579 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8580 pub mcc: u16,
8581 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8582 pub mnc: u16,
8583 #[doc = "Location area code. If unknown, set to 0"]
8584 pub lac: u16,
8585 #[doc = "Cellular modem status"]
8586 pub status: CellularStatusFlag,
8587 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8588 pub failure_reason: CellularNetworkFailedReason,
8589 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8590 pub mavtype: CellularNetworkRadioType,
8591 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8592 pub quality: u8,
8593}
8594impl CELLULAR_STATUS_DATA {
8595 pub const ENCODED_LEN: usize = 10usize;
8596 pub const DEFAULT: Self = Self {
8597 mcc: 0_u16,
8598 mnc: 0_u16,
8599 lac: 0_u16,
8600 status: CellularStatusFlag::DEFAULT,
8601 failure_reason: CellularNetworkFailedReason::DEFAULT,
8602 mavtype: CellularNetworkRadioType::DEFAULT,
8603 quality: 0_u8,
8604 };
8605 #[cfg(feature = "arbitrary")]
8606 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8607 use arbitrary::{Arbitrary, Unstructured};
8608 let mut buf = [0u8; 1024];
8609 rng.fill_bytes(&mut buf);
8610 let mut unstructured = Unstructured::new(&buf);
8611 Self::arbitrary(&mut unstructured).unwrap_or_default()
8612 }
8613}
8614impl Default for CELLULAR_STATUS_DATA {
8615 fn default() -> Self {
8616 Self::DEFAULT.clone()
8617 }
8618}
8619impl MessageData for CELLULAR_STATUS_DATA {
8620 type Message = MavMessage;
8621 const ID: u32 = 334u32;
8622 const NAME: &'static str = "CELLULAR_STATUS";
8623 const EXTRA_CRC: u8 = 72u8;
8624 const ENCODED_LEN: usize = 10usize;
8625 fn deser(
8626 _version: MavlinkVersion,
8627 __input: &[u8],
8628 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8629 let avail_len = __input.len();
8630 let mut payload_buf = [0; Self::ENCODED_LEN];
8631 let mut buf = if avail_len < Self::ENCODED_LEN {
8632 payload_buf[0..avail_len].copy_from_slice(__input);
8633 Bytes::new(&payload_buf)
8634 } else {
8635 Bytes::new(__input)
8636 };
8637 let mut __struct = Self::default();
8638 __struct.mcc = buf.get_u16_le();
8639 __struct.mnc = buf.get_u16_le();
8640 __struct.lac = buf.get_u16_le();
8641 let tmp = buf.get_u8();
8642 __struct.status =
8643 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8644 enum_type: "CellularStatusFlag",
8645 value: tmp as u64,
8646 })?;
8647 let tmp = buf.get_u8();
8648 __struct.failure_reason =
8649 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8650 enum_type: "CellularNetworkFailedReason",
8651 value: tmp as u64,
8652 })?;
8653 let tmp = buf.get_u8();
8654 __struct.mavtype =
8655 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8656 enum_type: "CellularNetworkRadioType",
8657 value: tmp as u64,
8658 })?;
8659 __struct.quality = buf.get_u8();
8660 Ok(__struct)
8661 }
8662 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8663 let mut __tmp = BytesMut::new(bytes);
8664 #[allow(clippy::absurd_extreme_comparisons)]
8665 #[allow(unused_comparisons)]
8666 if __tmp.remaining() < Self::ENCODED_LEN {
8667 panic!(
8668 "buffer is too small (need {} bytes, but got {})",
8669 Self::ENCODED_LEN,
8670 __tmp.remaining(),
8671 )
8672 }
8673 __tmp.put_u16_le(self.mcc);
8674 __tmp.put_u16_le(self.mnc);
8675 __tmp.put_u16_le(self.lac);
8676 __tmp.put_u8(self.status as u8);
8677 __tmp.put_u8(self.failure_reason as u8);
8678 __tmp.put_u8(self.mavtype as u8);
8679 __tmp.put_u8(self.quality);
8680 if matches!(version, MavlinkVersion::V2) {
8681 let len = __tmp.len();
8682 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8683 } else {
8684 __tmp.len()
8685 }
8686 }
8687}
8688#[doc = "Request to control this MAV."]
8689#[doc = ""]
8690#[doc = "ID: 5"]
8691#[derive(Debug, Clone, PartialEq)]
8692#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8693#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8694#[cfg_attr(feature = "ts", derive(TS))]
8695#[cfg_attr(feature = "ts", ts(export))]
8696pub struct CHANGE_OPERATOR_CONTROL_DATA {
8697 #[doc = "System the GCS requests control for"]
8698 pub target_system: u8,
8699 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8700 pub control_request: u8,
8701 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8702 pub version: u8,
8703 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8704 #[cfg_attr(feature = "ts", ts(type = "string"))]
8705 pub passkey: CharArray<25>,
8706}
8707impl CHANGE_OPERATOR_CONTROL_DATA {
8708 pub const ENCODED_LEN: usize = 28usize;
8709 pub const DEFAULT: Self = Self {
8710 target_system: 0_u8,
8711 control_request: 0_u8,
8712 version: 0_u8,
8713 passkey: CharArray::new([0_u8; 25usize]),
8714 };
8715 #[cfg(feature = "arbitrary")]
8716 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8717 use arbitrary::{Arbitrary, Unstructured};
8718 let mut buf = [0u8; 1024];
8719 rng.fill_bytes(&mut buf);
8720 let mut unstructured = Unstructured::new(&buf);
8721 Self::arbitrary(&mut unstructured).unwrap_or_default()
8722 }
8723}
8724impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8725 fn default() -> Self {
8726 Self::DEFAULT.clone()
8727 }
8728}
8729impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8730 type Message = MavMessage;
8731 const ID: u32 = 5u32;
8732 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8733 const EXTRA_CRC: u8 = 217u8;
8734 const ENCODED_LEN: usize = 28usize;
8735 fn deser(
8736 _version: MavlinkVersion,
8737 __input: &[u8],
8738 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8739 let avail_len = __input.len();
8740 let mut payload_buf = [0; Self::ENCODED_LEN];
8741 let mut buf = if avail_len < Self::ENCODED_LEN {
8742 payload_buf[0..avail_len].copy_from_slice(__input);
8743 Bytes::new(&payload_buf)
8744 } else {
8745 Bytes::new(__input)
8746 };
8747 let mut __struct = Self::default();
8748 __struct.target_system = buf.get_u8();
8749 __struct.control_request = buf.get_u8();
8750 __struct.version = buf.get_u8();
8751 let mut tmp = [0_u8; 25usize];
8752 for v in &mut tmp {
8753 *v = buf.get_u8();
8754 }
8755 __struct.passkey = CharArray::new(tmp);
8756 Ok(__struct)
8757 }
8758 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8759 let mut __tmp = BytesMut::new(bytes);
8760 #[allow(clippy::absurd_extreme_comparisons)]
8761 #[allow(unused_comparisons)]
8762 if __tmp.remaining() < Self::ENCODED_LEN {
8763 panic!(
8764 "buffer is too small (need {} bytes, but got {})",
8765 Self::ENCODED_LEN,
8766 __tmp.remaining(),
8767 )
8768 }
8769 __tmp.put_u8(self.target_system);
8770 __tmp.put_u8(self.control_request);
8771 __tmp.put_u8(self.version);
8772 for val in &self.passkey {
8773 __tmp.put_u8(*val);
8774 }
8775 if matches!(version, MavlinkVersion::V2) {
8776 let len = __tmp.len();
8777 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8778 } else {
8779 __tmp.len()
8780 }
8781 }
8782}
8783#[doc = "Accept / deny control of this MAV."]
8784#[doc = ""]
8785#[doc = "ID: 6"]
8786#[derive(Debug, Clone, PartialEq)]
8787#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8788#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8789#[cfg_attr(feature = "ts", derive(TS))]
8790#[cfg_attr(feature = "ts", ts(export))]
8791pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8792 #[doc = "ID of the GCS this message"]
8793 pub gcs_system_id: u8,
8794 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8795 pub control_request: u8,
8796 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8797 pub ack: u8,
8798}
8799impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8800 pub const ENCODED_LEN: usize = 3usize;
8801 pub const DEFAULT: Self = Self {
8802 gcs_system_id: 0_u8,
8803 control_request: 0_u8,
8804 ack: 0_u8,
8805 };
8806 #[cfg(feature = "arbitrary")]
8807 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8808 use arbitrary::{Arbitrary, Unstructured};
8809 let mut buf = [0u8; 1024];
8810 rng.fill_bytes(&mut buf);
8811 let mut unstructured = Unstructured::new(&buf);
8812 Self::arbitrary(&mut unstructured).unwrap_or_default()
8813 }
8814}
8815impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8816 fn default() -> Self {
8817 Self::DEFAULT.clone()
8818 }
8819}
8820impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8821 type Message = MavMessage;
8822 const ID: u32 = 6u32;
8823 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8824 const EXTRA_CRC: u8 = 104u8;
8825 const ENCODED_LEN: usize = 3usize;
8826 fn deser(
8827 _version: MavlinkVersion,
8828 __input: &[u8],
8829 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8830 let avail_len = __input.len();
8831 let mut payload_buf = [0; Self::ENCODED_LEN];
8832 let mut buf = if avail_len < Self::ENCODED_LEN {
8833 payload_buf[0..avail_len].copy_from_slice(__input);
8834 Bytes::new(&payload_buf)
8835 } else {
8836 Bytes::new(__input)
8837 };
8838 let mut __struct = Self::default();
8839 __struct.gcs_system_id = buf.get_u8();
8840 __struct.control_request = buf.get_u8();
8841 __struct.ack = buf.get_u8();
8842 Ok(__struct)
8843 }
8844 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8845 let mut __tmp = BytesMut::new(bytes);
8846 #[allow(clippy::absurd_extreme_comparisons)]
8847 #[allow(unused_comparisons)]
8848 if __tmp.remaining() < Self::ENCODED_LEN {
8849 panic!(
8850 "buffer is too small (need {} bytes, but got {})",
8851 Self::ENCODED_LEN,
8852 __tmp.remaining(),
8853 )
8854 }
8855 __tmp.put_u8(self.gcs_system_id);
8856 __tmp.put_u8(self.control_request);
8857 __tmp.put_u8(self.ack);
8858 if matches!(version, MavlinkVersion::V2) {
8859 let len = __tmp.len();
8860 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8861 } else {
8862 __tmp.len()
8863 }
8864 }
8865}
8866#[doc = "Information about a potential collision."]
8867#[doc = ""]
8868#[doc = "ID: 247"]
8869#[derive(Debug, Clone, PartialEq)]
8870#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8872#[cfg_attr(feature = "ts", derive(TS))]
8873#[cfg_attr(feature = "ts", ts(export))]
8874pub struct COLLISION_DATA {
8875 #[doc = "Unique identifier, domain based on src field"]
8876 pub id: u32,
8877 #[doc = "Estimated time until collision occurs"]
8878 pub time_to_minimum_delta: f32,
8879 #[doc = "Closest vertical distance between vehicle and object"]
8880 pub altitude_minimum_delta: f32,
8881 #[doc = "Closest horizontal distance between vehicle and object"]
8882 pub horizontal_minimum_delta: f32,
8883 #[doc = "Collision data source"]
8884 pub src: MavCollisionSrc,
8885 #[doc = "Action that is being taken to avoid this collision"]
8886 pub action: MavCollisionAction,
8887 #[doc = "How concerned the aircraft is about this collision"]
8888 pub threat_level: MavCollisionThreatLevel,
8889}
8890impl COLLISION_DATA {
8891 pub const ENCODED_LEN: usize = 19usize;
8892 pub const DEFAULT: Self = Self {
8893 id: 0_u32,
8894 time_to_minimum_delta: 0.0_f32,
8895 altitude_minimum_delta: 0.0_f32,
8896 horizontal_minimum_delta: 0.0_f32,
8897 src: MavCollisionSrc::DEFAULT,
8898 action: MavCollisionAction::DEFAULT,
8899 threat_level: MavCollisionThreatLevel::DEFAULT,
8900 };
8901 #[cfg(feature = "arbitrary")]
8902 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8903 use arbitrary::{Arbitrary, Unstructured};
8904 let mut buf = [0u8; 1024];
8905 rng.fill_bytes(&mut buf);
8906 let mut unstructured = Unstructured::new(&buf);
8907 Self::arbitrary(&mut unstructured).unwrap_or_default()
8908 }
8909}
8910impl Default for COLLISION_DATA {
8911 fn default() -> Self {
8912 Self::DEFAULT.clone()
8913 }
8914}
8915impl MessageData for COLLISION_DATA {
8916 type Message = MavMessage;
8917 const ID: u32 = 247u32;
8918 const NAME: &'static str = "COLLISION";
8919 const EXTRA_CRC: u8 = 81u8;
8920 const ENCODED_LEN: usize = 19usize;
8921 fn deser(
8922 _version: MavlinkVersion,
8923 __input: &[u8],
8924 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8925 let avail_len = __input.len();
8926 let mut payload_buf = [0; Self::ENCODED_LEN];
8927 let mut buf = if avail_len < Self::ENCODED_LEN {
8928 payload_buf[0..avail_len].copy_from_slice(__input);
8929 Bytes::new(&payload_buf)
8930 } else {
8931 Bytes::new(__input)
8932 };
8933 let mut __struct = Self::default();
8934 __struct.id = buf.get_u32_le();
8935 __struct.time_to_minimum_delta = buf.get_f32_le();
8936 __struct.altitude_minimum_delta = buf.get_f32_le();
8937 __struct.horizontal_minimum_delta = buf.get_f32_le();
8938 let tmp = buf.get_u8();
8939 __struct.src =
8940 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8941 enum_type: "MavCollisionSrc",
8942 value: tmp as u64,
8943 })?;
8944 let tmp = buf.get_u8();
8945 __struct.action =
8946 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8947 enum_type: "MavCollisionAction",
8948 value: tmp as u64,
8949 })?;
8950 let tmp = buf.get_u8();
8951 __struct.threat_level =
8952 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8953 enum_type: "MavCollisionThreatLevel",
8954 value: tmp as u64,
8955 })?;
8956 Ok(__struct)
8957 }
8958 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8959 let mut __tmp = BytesMut::new(bytes);
8960 #[allow(clippy::absurd_extreme_comparisons)]
8961 #[allow(unused_comparisons)]
8962 if __tmp.remaining() < Self::ENCODED_LEN {
8963 panic!(
8964 "buffer is too small (need {} bytes, but got {})",
8965 Self::ENCODED_LEN,
8966 __tmp.remaining(),
8967 )
8968 }
8969 __tmp.put_u32_le(self.id);
8970 __tmp.put_f32_le(self.time_to_minimum_delta);
8971 __tmp.put_f32_le(self.altitude_minimum_delta);
8972 __tmp.put_f32_le(self.horizontal_minimum_delta);
8973 __tmp.put_u8(self.src as u8);
8974 __tmp.put_u8(self.action as u8);
8975 __tmp.put_u8(self.threat_level as u8);
8976 if matches!(version, MavlinkVersion::V2) {
8977 let len = __tmp.len();
8978 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8979 } else {
8980 __tmp.len()
8981 }
8982 }
8983}
8984#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8985#[doc = ""]
8986#[doc = "ID: 77"]
8987#[derive(Debug, Clone, PartialEq)]
8988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8989#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8990#[cfg_attr(feature = "ts", derive(TS))]
8991#[cfg_attr(feature = "ts", ts(export))]
8992pub struct COMMAND_ACK_DATA {
8993 #[doc = "Command ID (of acknowledged command)."]
8994 pub command: MavCmd,
8995 #[doc = "Result of command."]
8996 pub result: MavResult,
8997 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
8998 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8999 pub progress: u8,
9000 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
9001 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9002 pub result_param2: i32,
9003 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9004 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9005 pub target_system: u8,
9006 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9007 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9008 pub target_component: u8,
9009}
9010impl COMMAND_ACK_DATA {
9011 pub const ENCODED_LEN: usize = 10usize;
9012 pub const DEFAULT: Self = Self {
9013 command: MavCmd::DEFAULT,
9014 result: MavResult::DEFAULT,
9015 progress: 0_u8,
9016 result_param2: 0_i32,
9017 target_system: 0_u8,
9018 target_component: 0_u8,
9019 };
9020 #[cfg(feature = "arbitrary")]
9021 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9022 use arbitrary::{Arbitrary, Unstructured};
9023 let mut buf = [0u8; 1024];
9024 rng.fill_bytes(&mut buf);
9025 let mut unstructured = Unstructured::new(&buf);
9026 Self::arbitrary(&mut unstructured).unwrap_or_default()
9027 }
9028}
9029impl Default for COMMAND_ACK_DATA {
9030 fn default() -> Self {
9031 Self::DEFAULT.clone()
9032 }
9033}
9034impl MessageData for COMMAND_ACK_DATA {
9035 type Message = MavMessage;
9036 const ID: u32 = 77u32;
9037 const NAME: &'static str = "COMMAND_ACK";
9038 const EXTRA_CRC: u8 = 143u8;
9039 const ENCODED_LEN: usize = 10usize;
9040 fn deser(
9041 _version: MavlinkVersion,
9042 __input: &[u8],
9043 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9044 let avail_len = __input.len();
9045 let mut payload_buf = [0; Self::ENCODED_LEN];
9046 let mut buf = if avail_len < Self::ENCODED_LEN {
9047 payload_buf[0..avail_len].copy_from_slice(__input);
9048 Bytes::new(&payload_buf)
9049 } else {
9050 Bytes::new(__input)
9051 };
9052 let mut __struct = Self::default();
9053 let tmp = buf.get_u16_le();
9054 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9055 ::mavlink_core::error::ParserError::InvalidEnum {
9056 enum_type: "MavCmd",
9057 value: tmp as u64,
9058 },
9059 )?;
9060 let tmp = buf.get_u8();
9061 __struct.result =
9062 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9063 enum_type: "MavResult",
9064 value: tmp as u64,
9065 })?;
9066 __struct.progress = buf.get_u8();
9067 __struct.result_param2 = buf.get_i32_le();
9068 __struct.target_system = buf.get_u8();
9069 __struct.target_component = buf.get_u8();
9070 Ok(__struct)
9071 }
9072 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9073 let mut __tmp = BytesMut::new(bytes);
9074 #[allow(clippy::absurd_extreme_comparisons)]
9075 #[allow(unused_comparisons)]
9076 if __tmp.remaining() < Self::ENCODED_LEN {
9077 panic!(
9078 "buffer is too small (need {} bytes, but got {})",
9079 Self::ENCODED_LEN,
9080 __tmp.remaining(),
9081 )
9082 }
9083 __tmp.put_u16_le(self.command as u16);
9084 __tmp.put_u8(self.result as u8);
9085 if matches!(version, MavlinkVersion::V2) {
9086 __tmp.put_u8(self.progress);
9087 __tmp.put_i32_le(self.result_param2);
9088 __tmp.put_u8(self.target_system);
9089 __tmp.put_u8(self.target_component);
9090 let len = __tmp.len();
9091 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9092 } else {
9093 __tmp.len()
9094 }
9095 }
9096}
9097#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9098#[doc = ""]
9099#[doc = "ID: 80"]
9100#[derive(Debug, Clone, PartialEq)]
9101#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9102#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9103#[cfg_attr(feature = "ts", derive(TS))]
9104#[cfg_attr(feature = "ts", ts(export))]
9105pub struct COMMAND_CANCEL_DATA {
9106 #[doc = "Command ID (of command to cancel)."]
9107 pub command: MavCmd,
9108 #[doc = "System executing long running command. Should not be broadcast (0)."]
9109 pub target_system: u8,
9110 #[doc = "Component executing long running command."]
9111 pub target_component: u8,
9112}
9113impl COMMAND_CANCEL_DATA {
9114 pub const ENCODED_LEN: usize = 4usize;
9115 pub const DEFAULT: Self = Self {
9116 command: MavCmd::DEFAULT,
9117 target_system: 0_u8,
9118 target_component: 0_u8,
9119 };
9120 #[cfg(feature = "arbitrary")]
9121 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9122 use arbitrary::{Arbitrary, Unstructured};
9123 let mut buf = [0u8; 1024];
9124 rng.fill_bytes(&mut buf);
9125 let mut unstructured = Unstructured::new(&buf);
9126 Self::arbitrary(&mut unstructured).unwrap_or_default()
9127 }
9128}
9129impl Default for COMMAND_CANCEL_DATA {
9130 fn default() -> Self {
9131 Self::DEFAULT.clone()
9132 }
9133}
9134impl MessageData for COMMAND_CANCEL_DATA {
9135 type Message = MavMessage;
9136 const ID: u32 = 80u32;
9137 const NAME: &'static str = "COMMAND_CANCEL";
9138 const EXTRA_CRC: u8 = 14u8;
9139 const ENCODED_LEN: usize = 4usize;
9140 fn deser(
9141 _version: MavlinkVersion,
9142 __input: &[u8],
9143 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9144 let avail_len = __input.len();
9145 let mut payload_buf = [0; Self::ENCODED_LEN];
9146 let mut buf = if avail_len < Self::ENCODED_LEN {
9147 payload_buf[0..avail_len].copy_from_slice(__input);
9148 Bytes::new(&payload_buf)
9149 } else {
9150 Bytes::new(__input)
9151 };
9152 let mut __struct = Self::default();
9153 let tmp = buf.get_u16_le();
9154 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9155 ::mavlink_core::error::ParserError::InvalidEnum {
9156 enum_type: "MavCmd",
9157 value: tmp as u64,
9158 },
9159 )?;
9160 __struct.target_system = buf.get_u8();
9161 __struct.target_component = buf.get_u8();
9162 Ok(__struct)
9163 }
9164 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9165 let mut __tmp = BytesMut::new(bytes);
9166 #[allow(clippy::absurd_extreme_comparisons)]
9167 #[allow(unused_comparisons)]
9168 if __tmp.remaining() < Self::ENCODED_LEN {
9169 panic!(
9170 "buffer is too small (need {} bytes, but got {})",
9171 Self::ENCODED_LEN,
9172 __tmp.remaining(),
9173 )
9174 }
9175 __tmp.put_u16_le(self.command as u16);
9176 __tmp.put_u8(self.target_system);
9177 __tmp.put_u8(self.target_component);
9178 if matches!(version, MavlinkVersion::V2) {
9179 let len = __tmp.len();
9180 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9181 } else {
9182 __tmp.len()
9183 }
9184 }
9185}
9186#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9187#[doc = ""]
9188#[doc = "ID: 75"]
9189#[derive(Debug, Clone, PartialEq)]
9190#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9191#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9192#[cfg_attr(feature = "ts", derive(TS))]
9193#[cfg_attr(feature = "ts", ts(export))]
9194pub struct COMMAND_INT_DATA {
9195 #[doc = "PARAM1, see MAV_CMD enum"]
9196 pub param1: f32,
9197 #[doc = "PARAM2, see MAV_CMD enum"]
9198 pub param2: f32,
9199 #[doc = "PARAM3, see MAV_CMD enum"]
9200 pub param3: f32,
9201 #[doc = "PARAM4, see MAV_CMD enum"]
9202 pub param4: f32,
9203 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9204 pub x: i32,
9205 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9206 pub y: i32,
9207 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9208 pub z: f32,
9209 #[doc = "The scheduled action for the mission item."]
9210 pub command: MavCmd,
9211 #[doc = "System ID"]
9212 pub target_system: u8,
9213 #[doc = "Component ID"]
9214 pub target_component: u8,
9215 #[doc = "The coordinate system of the COMMAND."]
9216 pub frame: MavFrame,
9217 #[doc = "Not used."]
9218 pub current: u8,
9219 #[doc = "Not used (set 0)."]
9220 pub autocontinue: u8,
9221}
9222impl COMMAND_INT_DATA {
9223 pub const ENCODED_LEN: usize = 35usize;
9224 pub const DEFAULT: Self = Self {
9225 param1: 0.0_f32,
9226 param2: 0.0_f32,
9227 param3: 0.0_f32,
9228 param4: 0.0_f32,
9229 x: 0_i32,
9230 y: 0_i32,
9231 z: 0.0_f32,
9232 command: MavCmd::DEFAULT,
9233 target_system: 0_u8,
9234 target_component: 0_u8,
9235 frame: MavFrame::DEFAULT,
9236 current: 0_u8,
9237 autocontinue: 0_u8,
9238 };
9239 #[cfg(feature = "arbitrary")]
9240 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9241 use arbitrary::{Arbitrary, Unstructured};
9242 let mut buf = [0u8; 1024];
9243 rng.fill_bytes(&mut buf);
9244 let mut unstructured = Unstructured::new(&buf);
9245 Self::arbitrary(&mut unstructured).unwrap_or_default()
9246 }
9247}
9248impl Default for COMMAND_INT_DATA {
9249 fn default() -> Self {
9250 Self::DEFAULT.clone()
9251 }
9252}
9253impl MessageData for COMMAND_INT_DATA {
9254 type Message = MavMessage;
9255 const ID: u32 = 75u32;
9256 const NAME: &'static str = "COMMAND_INT";
9257 const EXTRA_CRC: u8 = 158u8;
9258 const ENCODED_LEN: usize = 35usize;
9259 fn deser(
9260 _version: MavlinkVersion,
9261 __input: &[u8],
9262 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9263 let avail_len = __input.len();
9264 let mut payload_buf = [0; Self::ENCODED_LEN];
9265 let mut buf = if avail_len < Self::ENCODED_LEN {
9266 payload_buf[0..avail_len].copy_from_slice(__input);
9267 Bytes::new(&payload_buf)
9268 } else {
9269 Bytes::new(__input)
9270 };
9271 let mut __struct = Self::default();
9272 __struct.param1 = buf.get_f32_le();
9273 __struct.param2 = buf.get_f32_le();
9274 __struct.param3 = buf.get_f32_le();
9275 __struct.param4 = buf.get_f32_le();
9276 __struct.x = buf.get_i32_le();
9277 __struct.y = buf.get_i32_le();
9278 __struct.z = buf.get_f32_le();
9279 let tmp = buf.get_u16_le();
9280 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9281 ::mavlink_core::error::ParserError::InvalidEnum {
9282 enum_type: "MavCmd",
9283 value: tmp as u64,
9284 },
9285 )?;
9286 __struct.target_system = buf.get_u8();
9287 __struct.target_component = buf.get_u8();
9288 let tmp = buf.get_u8();
9289 __struct.frame =
9290 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9291 enum_type: "MavFrame",
9292 value: tmp as u64,
9293 })?;
9294 __struct.current = buf.get_u8();
9295 __struct.autocontinue = buf.get_u8();
9296 Ok(__struct)
9297 }
9298 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9299 let mut __tmp = BytesMut::new(bytes);
9300 #[allow(clippy::absurd_extreme_comparisons)]
9301 #[allow(unused_comparisons)]
9302 if __tmp.remaining() < Self::ENCODED_LEN {
9303 panic!(
9304 "buffer is too small (need {} bytes, but got {})",
9305 Self::ENCODED_LEN,
9306 __tmp.remaining(),
9307 )
9308 }
9309 __tmp.put_f32_le(self.param1);
9310 __tmp.put_f32_le(self.param2);
9311 __tmp.put_f32_le(self.param3);
9312 __tmp.put_f32_le(self.param4);
9313 __tmp.put_i32_le(self.x);
9314 __tmp.put_i32_le(self.y);
9315 __tmp.put_f32_le(self.z);
9316 __tmp.put_u16_le(self.command as u16);
9317 __tmp.put_u8(self.target_system);
9318 __tmp.put_u8(self.target_component);
9319 __tmp.put_u8(self.frame as u8);
9320 __tmp.put_u8(self.current);
9321 __tmp.put_u8(self.autocontinue);
9322 if matches!(version, MavlinkVersion::V2) {
9323 let len = __tmp.len();
9324 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9325 } else {
9326 __tmp.len()
9327 }
9328 }
9329}
9330#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9331#[doc = ""]
9332#[doc = "ID: 76"]
9333#[derive(Debug, Clone, PartialEq)]
9334#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9335#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9336#[cfg_attr(feature = "ts", derive(TS))]
9337#[cfg_attr(feature = "ts", ts(export))]
9338pub struct COMMAND_LONG_DATA {
9339 #[doc = "Parameter 1 (for the specific command)."]
9340 pub param1: f32,
9341 #[doc = "Parameter 2 (for the specific command)."]
9342 pub param2: f32,
9343 #[doc = "Parameter 3 (for the specific command)."]
9344 pub param3: f32,
9345 #[doc = "Parameter 4 (for the specific command)."]
9346 pub param4: f32,
9347 #[doc = "Parameter 5 (for the specific command)."]
9348 pub param5: f32,
9349 #[doc = "Parameter 6 (for the specific command)."]
9350 pub param6: f32,
9351 #[doc = "Parameter 7 (for the specific command)."]
9352 pub param7: f32,
9353 #[doc = "Command ID (of command to send)."]
9354 pub command: MavCmd,
9355 #[doc = "System which should execute the command"]
9356 pub target_system: u8,
9357 #[doc = "Component which should execute the command, 0 for all components"]
9358 pub target_component: u8,
9359 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9360 pub confirmation: u8,
9361}
9362impl COMMAND_LONG_DATA {
9363 pub const ENCODED_LEN: usize = 33usize;
9364 pub const DEFAULT: Self = Self {
9365 param1: 0.0_f32,
9366 param2: 0.0_f32,
9367 param3: 0.0_f32,
9368 param4: 0.0_f32,
9369 param5: 0.0_f32,
9370 param6: 0.0_f32,
9371 param7: 0.0_f32,
9372 command: MavCmd::DEFAULT,
9373 target_system: 0_u8,
9374 target_component: 0_u8,
9375 confirmation: 0_u8,
9376 };
9377 #[cfg(feature = "arbitrary")]
9378 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9379 use arbitrary::{Arbitrary, Unstructured};
9380 let mut buf = [0u8; 1024];
9381 rng.fill_bytes(&mut buf);
9382 let mut unstructured = Unstructured::new(&buf);
9383 Self::arbitrary(&mut unstructured).unwrap_or_default()
9384 }
9385}
9386impl Default for COMMAND_LONG_DATA {
9387 fn default() -> Self {
9388 Self::DEFAULT.clone()
9389 }
9390}
9391impl MessageData for COMMAND_LONG_DATA {
9392 type Message = MavMessage;
9393 const ID: u32 = 76u32;
9394 const NAME: &'static str = "COMMAND_LONG";
9395 const EXTRA_CRC: u8 = 152u8;
9396 const ENCODED_LEN: usize = 33usize;
9397 fn deser(
9398 _version: MavlinkVersion,
9399 __input: &[u8],
9400 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9401 let avail_len = __input.len();
9402 let mut payload_buf = [0; Self::ENCODED_LEN];
9403 let mut buf = if avail_len < Self::ENCODED_LEN {
9404 payload_buf[0..avail_len].copy_from_slice(__input);
9405 Bytes::new(&payload_buf)
9406 } else {
9407 Bytes::new(__input)
9408 };
9409 let mut __struct = Self::default();
9410 __struct.param1 = buf.get_f32_le();
9411 __struct.param2 = buf.get_f32_le();
9412 __struct.param3 = buf.get_f32_le();
9413 __struct.param4 = buf.get_f32_le();
9414 __struct.param5 = buf.get_f32_le();
9415 __struct.param6 = buf.get_f32_le();
9416 __struct.param7 = buf.get_f32_le();
9417 let tmp = buf.get_u16_le();
9418 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9419 ::mavlink_core::error::ParserError::InvalidEnum {
9420 enum_type: "MavCmd",
9421 value: tmp as u64,
9422 },
9423 )?;
9424 __struct.target_system = buf.get_u8();
9425 __struct.target_component = buf.get_u8();
9426 __struct.confirmation = buf.get_u8();
9427 Ok(__struct)
9428 }
9429 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9430 let mut __tmp = BytesMut::new(bytes);
9431 #[allow(clippy::absurd_extreme_comparisons)]
9432 #[allow(unused_comparisons)]
9433 if __tmp.remaining() < Self::ENCODED_LEN {
9434 panic!(
9435 "buffer is too small (need {} bytes, but got {})",
9436 Self::ENCODED_LEN,
9437 __tmp.remaining(),
9438 )
9439 }
9440 __tmp.put_f32_le(self.param1);
9441 __tmp.put_f32_le(self.param2);
9442 __tmp.put_f32_le(self.param3);
9443 __tmp.put_f32_le(self.param4);
9444 __tmp.put_f32_le(self.param5);
9445 __tmp.put_f32_le(self.param6);
9446 __tmp.put_f32_le(self.param7);
9447 __tmp.put_u16_le(self.command as u16);
9448 __tmp.put_u8(self.target_system);
9449 __tmp.put_u8(self.target_component);
9450 __tmp.put_u8(self.confirmation);
9451 if matches!(version, MavlinkVersion::V2) {
9452 let len = __tmp.len();
9453 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9454 } else {
9455 __tmp.len()
9456 }
9457 }
9458}
9459#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9460#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9461#[doc = ""]
9462#[doc = "ID: 395"]
9463#[derive(Debug, Clone, PartialEq)]
9464#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9465#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9466#[cfg_attr(feature = "ts", derive(TS))]
9467#[cfg_attr(feature = "ts", ts(export))]
9468pub struct COMPONENT_INFORMATION_DATA {
9469 #[doc = "Timestamp (time since system boot)."]
9470 pub time_boot_ms: u32,
9471 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9472 pub general_metadata_file_crc: u32,
9473 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9474 pub peripherals_metadata_file_crc: u32,
9475 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9476 #[cfg_attr(feature = "ts", ts(type = "string"))]
9477 pub general_metadata_uri: CharArray<100>,
9478 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9479 #[cfg_attr(feature = "ts", ts(type = "string"))]
9480 pub peripherals_metadata_uri: CharArray<100>,
9481}
9482impl COMPONENT_INFORMATION_DATA {
9483 pub const ENCODED_LEN: usize = 212usize;
9484 pub const DEFAULT: Self = Self {
9485 time_boot_ms: 0_u32,
9486 general_metadata_file_crc: 0_u32,
9487 peripherals_metadata_file_crc: 0_u32,
9488 general_metadata_uri: CharArray::new([0_u8; 100usize]),
9489 peripherals_metadata_uri: CharArray::new([0_u8; 100usize]),
9490 };
9491 #[cfg(feature = "arbitrary")]
9492 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9493 use arbitrary::{Arbitrary, Unstructured};
9494 let mut buf = [0u8; 1024];
9495 rng.fill_bytes(&mut buf);
9496 let mut unstructured = Unstructured::new(&buf);
9497 Self::arbitrary(&mut unstructured).unwrap_or_default()
9498 }
9499}
9500impl Default for COMPONENT_INFORMATION_DATA {
9501 fn default() -> Self {
9502 Self::DEFAULT.clone()
9503 }
9504}
9505impl MessageData for COMPONENT_INFORMATION_DATA {
9506 type Message = MavMessage;
9507 const ID: u32 = 395u32;
9508 const NAME: &'static str = "COMPONENT_INFORMATION";
9509 const EXTRA_CRC: u8 = 0u8;
9510 const ENCODED_LEN: usize = 212usize;
9511 fn deser(
9512 _version: MavlinkVersion,
9513 __input: &[u8],
9514 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9515 let avail_len = __input.len();
9516 let mut payload_buf = [0; Self::ENCODED_LEN];
9517 let mut buf = if avail_len < Self::ENCODED_LEN {
9518 payload_buf[0..avail_len].copy_from_slice(__input);
9519 Bytes::new(&payload_buf)
9520 } else {
9521 Bytes::new(__input)
9522 };
9523 let mut __struct = Self::default();
9524 __struct.time_boot_ms = buf.get_u32_le();
9525 __struct.general_metadata_file_crc = buf.get_u32_le();
9526 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9527 let mut tmp = [0_u8; 100usize];
9528 for v in &mut tmp {
9529 *v = buf.get_u8();
9530 }
9531 __struct.general_metadata_uri = CharArray::new(tmp);
9532 let mut tmp = [0_u8; 100usize];
9533 for v in &mut tmp {
9534 *v = buf.get_u8();
9535 }
9536 __struct.peripherals_metadata_uri = CharArray::new(tmp);
9537 Ok(__struct)
9538 }
9539 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9540 let mut __tmp = BytesMut::new(bytes);
9541 #[allow(clippy::absurd_extreme_comparisons)]
9542 #[allow(unused_comparisons)]
9543 if __tmp.remaining() < Self::ENCODED_LEN {
9544 panic!(
9545 "buffer is too small (need {} bytes, but got {})",
9546 Self::ENCODED_LEN,
9547 __tmp.remaining(),
9548 )
9549 }
9550 __tmp.put_u32_le(self.time_boot_ms);
9551 __tmp.put_u32_le(self.general_metadata_file_crc);
9552 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9553 for val in &self.general_metadata_uri {
9554 __tmp.put_u8(*val);
9555 }
9556 for val in &self.peripherals_metadata_uri {
9557 __tmp.put_u8(*val);
9558 }
9559 if matches!(version, MavlinkVersion::V2) {
9560 let len = __tmp.len();
9561 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9562 } else {
9563 __tmp.len()
9564 }
9565 }
9566}
9567#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9568#[doc = ""]
9569#[doc = "ID: 396"]
9570#[derive(Debug, Clone, PartialEq)]
9571#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9572#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9573#[cfg_attr(feature = "ts", derive(TS))]
9574#[cfg_attr(feature = "ts", ts(export))]
9575pub struct COMPONENT_INFORMATION_BASIC_DATA {
9576 #[doc = "Component capability flags"]
9577 pub capabilities: MavProtocolCapability,
9578 #[doc = "Timestamp (time since system boot)."]
9579 pub time_boot_ms: u32,
9580 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9581 pub time_manufacture_s: u32,
9582 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9583 #[cfg_attr(feature = "ts", ts(type = "string"))]
9584 pub vendor_name: CharArray<32>,
9585 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9586 #[cfg_attr(feature = "ts", ts(type = "string"))]
9587 pub model_name: CharArray<32>,
9588 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9589 #[cfg_attr(feature = "ts", ts(type = "string"))]
9590 pub software_version: CharArray<24>,
9591 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9592 #[cfg_attr(feature = "ts", ts(type = "string"))]
9593 pub hardware_version: CharArray<24>,
9594 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9595 #[cfg_attr(feature = "ts", ts(type = "string"))]
9596 pub serial_number: CharArray<32>,
9597}
9598impl COMPONENT_INFORMATION_BASIC_DATA {
9599 pub const ENCODED_LEN: usize = 160usize;
9600 pub const DEFAULT: Self = Self {
9601 capabilities: MavProtocolCapability::DEFAULT,
9602 time_boot_ms: 0_u32,
9603 time_manufacture_s: 0_u32,
9604 vendor_name: CharArray::new([0_u8; 32usize]),
9605 model_name: CharArray::new([0_u8; 32usize]),
9606 software_version: CharArray::new([0_u8; 24usize]),
9607 hardware_version: CharArray::new([0_u8; 24usize]),
9608 serial_number: CharArray::new([0_u8; 32usize]),
9609 };
9610 #[cfg(feature = "arbitrary")]
9611 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9612 use arbitrary::{Arbitrary, Unstructured};
9613 let mut buf = [0u8; 1024];
9614 rng.fill_bytes(&mut buf);
9615 let mut unstructured = Unstructured::new(&buf);
9616 Self::arbitrary(&mut unstructured).unwrap_or_default()
9617 }
9618}
9619impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9620 fn default() -> Self {
9621 Self::DEFAULT.clone()
9622 }
9623}
9624impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9625 type Message = MavMessage;
9626 const ID: u32 = 396u32;
9627 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9628 const EXTRA_CRC: u8 = 50u8;
9629 const ENCODED_LEN: usize = 160usize;
9630 fn deser(
9631 _version: MavlinkVersion,
9632 __input: &[u8],
9633 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9634 let avail_len = __input.len();
9635 let mut payload_buf = [0; Self::ENCODED_LEN];
9636 let mut buf = if avail_len < Self::ENCODED_LEN {
9637 payload_buf[0..avail_len].copy_from_slice(__input);
9638 Bytes::new(&payload_buf)
9639 } else {
9640 Bytes::new(__input)
9641 };
9642 let mut __struct = Self::default();
9643 let tmp = buf.get_u64_le();
9644 __struct.capabilities = MavProtocolCapability::from_bits(
9645 tmp as <MavProtocolCapability as Flags>::Bits,
9646 )
9647 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9648 flag_type: "MavProtocolCapability",
9649 value: tmp as u64,
9650 })?;
9651 __struct.time_boot_ms = buf.get_u32_le();
9652 __struct.time_manufacture_s = buf.get_u32_le();
9653 let mut tmp = [0_u8; 32usize];
9654 for v in &mut tmp {
9655 *v = buf.get_u8();
9656 }
9657 __struct.vendor_name = CharArray::new(tmp);
9658 let mut tmp = [0_u8; 32usize];
9659 for v in &mut tmp {
9660 *v = buf.get_u8();
9661 }
9662 __struct.model_name = CharArray::new(tmp);
9663 let mut tmp = [0_u8; 24usize];
9664 for v in &mut tmp {
9665 *v = buf.get_u8();
9666 }
9667 __struct.software_version = CharArray::new(tmp);
9668 let mut tmp = [0_u8; 24usize];
9669 for v in &mut tmp {
9670 *v = buf.get_u8();
9671 }
9672 __struct.hardware_version = CharArray::new(tmp);
9673 let mut tmp = [0_u8; 32usize];
9674 for v in &mut tmp {
9675 *v = buf.get_u8();
9676 }
9677 __struct.serial_number = CharArray::new(tmp);
9678 Ok(__struct)
9679 }
9680 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9681 let mut __tmp = BytesMut::new(bytes);
9682 #[allow(clippy::absurd_extreme_comparisons)]
9683 #[allow(unused_comparisons)]
9684 if __tmp.remaining() < Self::ENCODED_LEN {
9685 panic!(
9686 "buffer is too small (need {} bytes, but got {})",
9687 Self::ENCODED_LEN,
9688 __tmp.remaining(),
9689 )
9690 }
9691 __tmp.put_u64_le(self.capabilities.bits() as u64);
9692 __tmp.put_u32_le(self.time_boot_ms);
9693 __tmp.put_u32_le(self.time_manufacture_s);
9694 for val in &self.vendor_name {
9695 __tmp.put_u8(*val);
9696 }
9697 for val in &self.model_name {
9698 __tmp.put_u8(*val);
9699 }
9700 for val in &self.software_version {
9701 __tmp.put_u8(*val);
9702 }
9703 for val in &self.hardware_version {
9704 __tmp.put_u8(*val);
9705 }
9706 for val in &self.serial_number {
9707 __tmp.put_u8(*val);
9708 }
9709 if matches!(version, MavlinkVersion::V2) {
9710 let len = __tmp.len();
9711 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9712 } else {
9713 __tmp.len()
9714 }
9715 }
9716}
9717#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9718#[doc = ""]
9719#[doc = "ID: 397"]
9720#[derive(Debug, Clone, PartialEq)]
9721#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9722#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9723#[cfg_attr(feature = "ts", derive(TS))]
9724#[cfg_attr(feature = "ts", ts(export))]
9725pub struct COMPONENT_METADATA_DATA {
9726 #[doc = "Timestamp (time since system boot)."]
9727 pub time_boot_ms: u32,
9728 #[doc = "CRC32 of the general metadata file."]
9729 pub file_crc: u32,
9730 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9731 #[cfg_attr(feature = "ts", ts(type = "string"))]
9732 pub uri: CharArray<100>,
9733}
9734impl COMPONENT_METADATA_DATA {
9735 pub const ENCODED_LEN: usize = 108usize;
9736 pub const DEFAULT: Self = Self {
9737 time_boot_ms: 0_u32,
9738 file_crc: 0_u32,
9739 uri: CharArray::new([0_u8; 100usize]),
9740 };
9741 #[cfg(feature = "arbitrary")]
9742 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9743 use arbitrary::{Arbitrary, Unstructured};
9744 let mut buf = [0u8; 1024];
9745 rng.fill_bytes(&mut buf);
9746 let mut unstructured = Unstructured::new(&buf);
9747 Self::arbitrary(&mut unstructured).unwrap_or_default()
9748 }
9749}
9750impl Default for COMPONENT_METADATA_DATA {
9751 fn default() -> Self {
9752 Self::DEFAULT.clone()
9753 }
9754}
9755impl MessageData for COMPONENT_METADATA_DATA {
9756 type Message = MavMessage;
9757 const ID: u32 = 397u32;
9758 const NAME: &'static str = "COMPONENT_METADATA";
9759 const EXTRA_CRC: u8 = 182u8;
9760 const ENCODED_LEN: usize = 108usize;
9761 fn deser(
9762 _version: MavlinkVersion,
9763 __input: &[u8],
9764 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9765 let avail_len = __input.len();
9766 let mut payload_buf = [0; Self::ENCODED_LEN];
9767 let mut buf = if avail_len < Self::ENCODED_LEN {
9768 payload_buf[0..avail_len].copy_from_slice(__input);
9769 Bytes::new(&payload_buf)
9770 } else {
9771 Bytes::new(__input)
9772 };
9773 let mut __struct = Self::default();
9774 __struct.time_boot_ms = buf.get_u32_le();
9775 __struct.file_crc = buf.get_u32_le();
9776 let mut tmp = [0_u8; 100usize];
9777 for v in &mut tmp {
9778 *v = buf.get_u8();
9779 }
9780 __struct.uri = CharArray::new(tmp);
9781 Ok(__struct)
9782 }
9783 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9784 let mut __tmp = BytesMut::new(bytes);
9785 #[allow(clippy::absurd_extreme_comparisons)]
9786 #[allow(unused_comparisons)]
9787 if __tmp.remaining() < Self::ENCODED_LEN {
9788 panic!(
9789 "buffer is too small (need {} bytes, but got {})",
9790 Self::ENCODED_LEN,
9791 __tmp.remaining(),
9792 )
9793 }
9794 __tmp.put_u32_le(self.time_boot_ms);
9795 __tmp.put_u32_le(self.file_crc);
9796 for val in &self.uri {
9797 __tmp.put_u8(*val);
9798 }
9799 if matches!(version, MavlinkVersion::V2) {
9800 let len = __tmp.len();
9801 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9802 } else {
9803 __tmp.len()
9804 }
9805 }
9806}
9807#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9808#[doc = ""]
9809#[doc = "ID: 146"]
9810#[derive(Debug, Clone, PartialEq)]
9811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9812#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9813#[cfg_attr(feature = "ts", derive(TS))]
9814#[cfg_attr(feature = "ts", ts(export))]
9815pub struct CONTROL_SYSTEM_STATE_DATA {
9816 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9817 pub time_usec: u64,
9818 #[doc = "X acceleration in body frame"]
9819 pub x_acc: f32,
9820 #[doc = "Y acceleration in body frame"]
9821 pub y_acc: f32,
9822 #[doc = "Z acceleration in body frame"]
9823 pub z_acc: f32,
9824 #[doc = "X velocity in body frame"]
9825 pub x_vel: f32,
9826 #[doc = "Y velocity in body frame"]
9827 pub y_vel: f32,
9828 #[doc = "Z velocity in body frame"]
9829 pub z_vel: f32,
9830 #[doc = "X position in local frame"]
9831 pub x_pos: f32,
9832 #[doc = "Y position in local frame"]
9833 pub y_pos: f32,
9834 #[doc = "Z position in local frame"]
9835 pub z_pos: f32,
9836 #[doc = "Airspeed, set to -1 if unknown"]
9837 pub airspeed: f32,
9838 #[doc = "Variance of body velocity estimate"]
9839 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9840 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9841 pub vel_variance: [f32; 3],
9842 #[doc = "Variance in local position"]
9843 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9844 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9845 pub pos_variance: [f32; 3],
9846 #[doc = "The attitude, represented as Quaternion"]
9847 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9848 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9849 pub q: [f32; 4],
9850 #[doc = "Angular rate in roll axis"]
9851 pub roll_rate: f32,
9852 #[doc = "Angular rate in pitch axis"]
9853 pub pitch_rate: f32,
9854 #[doc = "Angular rate in yaw axis"]
9855 pub yaw_rate: f32,
9856}
9857impl CONTROL_SYSTEM_STATE_DATA {
9858 pub const ENCODED_LEN: usize = 100usize;
9859 pub const DEFAULT: Self = Self {
9860 time_usec: 0_u64,
9861 x_acc: 0.0_f32,
9862 y_acc: 0.0_f32,
9863 z_acc: 0.0_f32,
9864 x_vel: 0.0_f32,
9865 y_vel: 0.0_f32,
9866 z_vel: 0.0_f32,
9867 x_pos: 0.0_f32,
9868 y_pos: 0.0_f32,
9869 z_pos: 0.0_f32,
9870 airspeed: 0.0_f32,
9871 vel_variance: [0.0_f32; 3usize],
9872 pos_variance: [0.0_f32; 3usize],
9873 q: [0.0_f32; 4usize],
9874 roll_rate: 0.0_f32,
9875 pitch_rate: 0.0_f32,
9876 yaw_rate: 0.0_f32,
9877 };
9878 #[cfg(feature = "arbitrary")]
9879 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9880 use arbitrary::{Arbitrary, Unstructured};
9881 let mut buf = [0u8; 1024];
9882 rng.fill_bytes(&mut buf);
9883 let mut unstructured = Unstructured::new(&buf);
9884 Self::arbitrary(&mut unstructured).unwrap_or_default()
9885 }
9886}
9887impl Default for CONTROL_SYSTEM_STATE_DATA {
9888 fn default() -> Self {
9889 Self::DEFAULT.clone()
9890 }
9891}
9892impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9893 type Message = MavMessage;
9894 const ID: u32 = 146u32;
9895 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9896 const EXTRA_CRC: u8 = 103u8;
9897 const ENCODED_LEN: usize = 100usize;
9898 fn deser(
9899 _version: MavlinkVersion,
9900 __input: &[u8],
9901 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9902 let avail_len = __input.len();
9903 let mut payload_buf = [0; Self::ENCODED_LEN];
9904 let mut buf = if avail_len < Self::ENCODED_LEN {
9905 payload_buf[0..avail_len].copy_from_slice(__input);
9906 Bytes::new(&payload_buf)
9907 } else {
9908 Bytes::new(__input)
9909 };
9910 let mut __struct = Self::default();
9911 __struct.time_usec = buf.get_u64_le();
9912 __struct.x_acc = buf.get_f32_le();
9913 __struct.y_acc = buf.get_f32_le();
9914 __struct.z_acc = buf.get_f32_le();
9915 __struct.x_vel = buf.get_f32_le();
9916 __struct.y_vel = buf.get_f32_le();
9917 __struct.z_vel = buf.get_f32_le();
9918 __struct.x_pos = buf.get_f32_le();
9919 __struct.y_pos = buf.get_f32_le();
9920 __struct.z_pos = buf.get_f32_le();
9921 __struct.airspeed = buf.get_f32_le();
9922 for v in &mut __struct.vel_variance {
9923 let val = buf.get_f32_le();
9924 *v = val;
9925 }
9926 for v in &mut __struct.pos_variance {
9927 let val = buf.get_f32_le();
9928 *v = val;
9929 }
9930 for v in &mut __struct.q {
9931 let val = buf.get_f32_le();
9932 *v = val;
9933 }
9934 __struct.roll_rate = buf.get_f32_le();
9935 __struct.pitch_rate = buf.get_f32_le();
9936 __struct.yaw_rate = buf.get_f32_le();
9937 Ok(__struct)
9938 }
9939 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9940 let mut __tmp = BytesMut::new(bytes);
9941 #[allow(clippy::absurd_extreme_comparisons)]
9942 #[allow(unused_comparisons)]
9943 if __tmp.remaining() < Self::ENCODED_LEN {
9944 panic!(
9945 "buffer is too small (need {} bytes, but got {})",
9946 Self::ENCODED_LEN,
9947 __tmp.remaining(),
9948 )
9949 }
9950 __tmp.put_u64_le(self.time_usec);
9951 __tmp.put_f32_le(self.x_acc);
9952 __tmp.put_f32_le(self.y_acc);
9953 __tmp.put_f32_le(self.z_acc);
9954 __tmp.put_f32_le(self.x_vel);
9955 __tmp.put_f32_le(self.y_vel);
9956 __tmp.put_f32_le(self.z_vel);
9957 __tmp.put_f32_le(self.x_pos);
9958 __tmp.put_f32_le(self.y_pos);
9959 __tmp.put_f32_le(self.z_pos);
9960 __tmp.put_f32_le(self.airspeed);
9961 for val in &self.vel_variance {
9962 __tmp.put_f32_le(*val);
9963 }
9964 for val in &self.pos_variance {
9965 __tmp.put_f32_le(*val);
9966 }
9967 for val in &self.q {
9968 __tmp.put_f32_le(*val);
9969 }
9970 __tmp.put_f32_le(self.roll_rate);
9971 __tmp.put_f32_le(self.pitch_rate);
9972 __tmp.put_f32_le(self.yaw_rate);
9973 if matches!(version, MavlinkVersion::V2) {
9974 let len = __tmp.len();
9975 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9976 } else {
9977 __tmp.len()
9978 }
9979 }
9980}
9981#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
9982#[doc = ""]
9983#[doc = "ID: 411"]
9984#[derive(Debug, Clone, PartialEq)]
9985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9987#[cfg_attr(feature = "ts", derive(TS))]
9988#[cfg_attr(feature = "ts", ts(export))]
9989pub struct CURRENT_EVENT_SEQUENCE_DATA {
9990 #[doc = "Sequence number."]
9991 pub sequence: u16,
9992 #[doc = "Flag bitset."]
9993 pub flags: MavEventCurrentSequenceFlags,
9994}
9995impl CURRENT_EVENT_SEQUENCE_DATA {
9996 pub const ENCODED_LEN: usize = 3usize;
9997 pub const DEFAULT: Self = Self {
9998 sequence: 0_u16,
9999 flags: MavEventCurrentSequenceFlags::DEFAULT,
10000 };
10001 #[cfg(feature = "arbitrary")]
10002 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10003 use arbitrary::{Arbitrary, Unstructured};
10004 let mut buf = [0u8; 1024];
10005 rng.fill_bytes(&mut buf);
10006 let mut unstructured = Unstructured::new(&buf);
10007 Self::arbitrary(&mut unstructured).unwrap_or_default()
10008 }
10009}
10010impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10011 fn default() -> Self {
10012 Self::DEFAULT.clone()
10013 }
10014}
10015impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10016 type Message = MavMessage;
10017 const ID: u32 = 411u32;
10018 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10019 const EXTRA_CRC: u8 = 106u8;
10020 const ENCODED_LEN: usize = 3usize;
10021 fn deser(
10022 _version: MavlinkVersion,
10023 __input: &[u8],
10024 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10025 let avail_len = __input.len();
10026 let mut payload_buf = [0; Self::ENCODED_LEN];
10027 let mut buf = if avail_len < Self::ENCODED_LEN {
10028 payload_buf[0..avail_len].copy_from_slice(__input);
10029 Bytes::new(&payload_buf)
10030 } else {
10031 Bytes::new(__input)
10032 };
10033 let mut __struct = Self::default();
10034 __struct.sequence = buf.get_u16_le();
10035 let tmp = buf.get_u8();
10036 __struct.flags =
10037 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10038 enum_type: "MavEventCurrentSequenceFlags",
10039 value: tmp as u64,
10040 })?;
10041 Ok(__struct)
10042 }
10043 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10044 let mut __tmp = BytesMut::new(bytes);
10045 #[allow(clippy::absurd_extreme_comparisons)]
10046 #[allow(unused_comparisons)]
10047 if __tmp.remaining() < Self::ENCODED_LEN {
10048 panic!(
10049 "buffer is too small (need {} bytes, but got {})",
10050 Self::ENCODED_LEN,
10051 __tmp.remaining(),
10052 )
10053 }
10054 __tmp.put_u16_le(self.sequence);
10055 __tmp.put_u8(self.flags as u8);
10056 if matches!(version, MavlinkVersion::V2) {
10057 let len = __tmp.len();
10058 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10059 } else {
10060 __tmp.len()
10061 }
10062 }
10063}
10064#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10065#[doc = ""]
10066#[doc = "ID: 436"]
10067#[derive(Debug, Clone, PartialEq)]
10068#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10069#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10070#[cfg_attr(feature = "ts", derive(TS))]
10071#[cfg_attr(feature = "ts", ts(export))]
10072pub struct CURRENT_MODE_DATA {
10073 #[doc = "A bitfield for use for autopilot-specific flags"]
10074 pub custom_mode: u32,
10075 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10076 pub intended_custom_mode: u32,
10077 #[doc = "Standard mode."]
10078 pub standard_mode: MavStandardMode,
10079}
10080impl CURRENT_MODE_DATA {
10081 pub const ENCODED_LEN: usize = 9usize;
10082 pub const DEFAULT: Self = Self {
10083 custom_mode: 0_u32,
10084 intended_custom_mode: 0_u32,
10085 standard_mode: MavStandardMode::DEFAULT,
10086 };
10087 #[cfg(feature = "arbitrary")]
10088 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10089 use arbitrary::{Arbitrary, Unstructured};
10090 let mut buf = [0u8; 1024];
10091 rng.fill_bytes(&mut buf);
10092 let mut unstructured = Unstructured::new(&buf);
10093 Self::arbitrary(&mut unstructured).unwrap_or_default()
10094 }
10095}
10096impl Default for CURRENT_MODE_DATA {
10097 fn default() -> Self {
10098 Self::DEFAULT.clone()
10099 }
10100}
10101impl MessageData for CURRENT_MODE_DATA {
10102 type Message = MavMessage;
10103 const ID: u32 = 436u32;
10104 const NAME: &'static str = "CURRENT_MODE";
10105 const EXTRA_CRC: u8 = 193u8;
10106 const ENCODED_LEN: usize = 9usize;
10107 fn deser(
10108 _version: MavlinkVersion,
10109 __input: &[u8],
10110 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10111 let avail_len = __input.len();
10112 let mut payload_buf = [0; Self::ENCODED_LEN];
10113 let mut buf = if avail_len < Self::ENCODED_LEN {
10114 payload_buf[0..avail_len].copy_from_slice(__input);
10115 Bytes::new(&payload_buf)
10116 } else {
10117 Bytes::new(__input)
10118 };
10119 let mut __struct = Self::default();
10120 __struct.custom_mode = buf.get_u32_le();
10121 __struct.intended_custom_mode = buf.get_u32_le();
10122 let tmp = buf.get_u8();
10123 __struct.standard_mode =
10124 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10125 enum_type: "MavStandardMode",
10126 value: tmp as u64,
10127 })?;
10128 Ok(__struct)
10129 }
10130 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10131 let mut __tmp = BytesMut::new(bytes);
10132 #[allow(clippy::absurd_extreme_comparisons)]
10133 #[allow(unused_comparisons)]
10134 if __tmp.remaining() < Self::ENCODED_LEN {
10135 panic!(
10136 "buffer is too small (need {} bytes, but got {})",
10137 Self::ENCODED_LEN,
10138 __tmp.remaining(),
10139 )
10140 }
10141 __tmp.put_u32_le(self.custom_mode);
10142 __tmp.put_u32_le(self.intended_custom_mode);
10143 __tmp.put_u8(self.standard_mode as u8);
10144 if matches!(version, MavlinkVersion::V2) {
10145 let len = __tmp.len();
10146 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10147 } else {
10148 __tmp.len()
10149 }
10150 }
10151}
10152#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10153#[doc = "Data stream status information."]
10154#[doc = ""]
10155#[doc = "ID: 67"]
10156#[derive(Debug, Clone, PartialEq)]
10157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10159#[cfg_attr(feature = "ts", derive(TS))]
10160#[cfg_attr(feature = "ts", ts(export))]
10161pub struct DATA_STREAM_DATA {
10162 #[doc = "The message rate"]
10163 pub message_rate: u16,
10164 #[doc = "The ID of the requested data stream"]
10165 pub stream_id: u8,
10166 #[doc = "1 stream is enabled, 0 stream is stopped."]
10167 pub on_off: u8,
10168}
10169impl DATA_STREAM_DATA {
10170 pub const ENCODED_LEN: usize = 4usize;
10171 pub const DEFAULT: Self = Self {
10172 message_rate: 0_u16,
10173 stream_id: 0_u8,
10174 on_off: 0_u8,
10175 };
10176 #[cfg(feature = "arbitrary")]
10177 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10178 use arbitrary::{Arbitrary, Unstructured};
10179 let mut buf = [0u8; 1024];
10180 rng.fill_bytes(&mut buf);
10181 let mut unstructured = Unstructured::new(&buf);
10182 Self::arbitrary(&mut unstructured).unwrap_or_default()
10183 }
10184}
10185impl Default for DATA_STREAM_DATA {
10186 fn default() -> Self {
10187 Self::DEFAULT.clone()
10188 }
10189}
10190impl MessageData for DATA_STREAM_DATA {
10191 type Message = MavMessage;
10192 const ID: u32 = 67u32;
10193 const NAME: &'static str = "DATA_STREAM";
10194 const EXTRA_CRC: u8 = 21u8;
10195 const ENCODED_LEN: usize = 4usize;
10196 fn deser(
10197 _version: MavlinkVersion,
10198 __input: &[u8],
10199 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10200 let avail_len = __input.len();
10201 let mut payload_buf = [0; Self::ENCODED_LEN];
10202 let mut buf = if avail_len < Self::ENCODED_LEN {
10203 payload_buf[0..avail_len].copy_from_slice(__input);
10204 Bytes::new(&payload_buf)
10205 } else {
10206 Bytes::new(__input)
10207 };
10208 let mut __struct = Self::default();
10209 __struct.message_rate = buf.get_u16_le();
10210 __struct.stream_id = buf.get_u8();
10211 __struct.on_off = buf.get_u8();
10212 Ok(__struct)
10213 }
10214 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10215 let mut __tmp = BytesMut::new(bytes);
10216 #[allow(clippy::absurd_extreme_comparisons)]
10217 #[allow(unused_comparisons)]
10218 if __tmp.remaining() < Self::ENCODED_LEN {
10219 panic!(
10220 "buffer is too small (need {} bytes, but got {})",
10221 Self::ENCODED_LEN,
10222 __tmp.remaining(),
10223 )
10224 }
10225 __tmp.put_u16_le(self.message_rate);
10226 __tmp.put_u8(self.stream_id);
10227 __tmp.put_u8(self.on_off);
10228 if matches!(version, MavlinkVersion::V2) {
10229 let len = __tmp.len();
10230 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10231 } else {
10232 __tmp.len()
10233 }
10234 }
10235}
10236#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10237#[doc = ""]
10238#[doc = "ID: 130"]
10239#[derive(Debug, Clone, PartialEq)]
10240#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10241#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10242#[cfg_attr(feature = "ts", derive(TS))]
10243#[cfg_attr(feature = "ts", ts(export))]
10244pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10245 #[doc = "total data size (set on ACK only)."]
10246 pub size: u32,
10247 #[doc = "Width of a matrix or image."]
10248 pub width: u16,
10249 #[doc = "Height of a matrix or image."]
10250 pub height: u16,
10251 #[doc = "Number of packets being sent (set on ACK only)."]
10252 pub packets: u16,
10253 #[doc = "Type of requested/acknowledged data."]
10254 pub mavtype: MavlinkDataStreamType,
10255 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10256 pub payload: u8,
10257 #[doc = "JPEG quality. Values: [1-100]."]
10258 pub jpg_quality: u8,
10259}
10260impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10261 pub const ENCODED_LEN: usize = 13usize;
10262 pub const DEFAULT: Self = Self {
10263 size: 0_u32,
10264 width: 0_u16,
10265 height: 0_u16,
10266 packets: 0_u16,
10267 mavtype: MavlinkDataStreamType::DEFAULT,
10268 payload: 0_u8,
10269 jpg_quality: 0_u8,
10270 };
10271 #[cfg(feature = "arbitrary")]
10272 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10273 use arbitrary::{Arbitrary, Unstructured};
10274 let mut buf = [0u8; 1024];
10275 rng.fill_bytes(&mut buf);
10276 let mut unstructured = Unstructured::new(&buf);
10277 Self::arbitrary(&mut unstructured).unwrap_or_default()
10278 }
10279}
10280impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10281 fn default() -> Self {
10282 Self::DEFAULT.clone()
10283 }
10284}
10285impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10286 type Message = MavMessage;
10287 const ID: u32 = 130u32;
10288 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10289 const EXTRA_CRC: u8 = 29u8;
10290 const ENCODED_LEN: usize = 13usize;
10291 fn deser(
10292 _version: MavlinkVersion,
10293 __input: &[u8],
10294 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10295 let avail_len = __input.len();
10296 let mut payload_buf = [0; Self::ENCODED_LEN];
10297 let mut buf = if avail_len < Self::ENCODED_LEN {
10298 payload_buf[0..avail_len].copy_from_slice(__input);
10299 Bytes::new(&payload_buf)
10300 } else {
10301 Bytes::new(__input)
10302 };
10303 let mut __struct = Self::default();
10304 __struct.size = buf.get_u32_le();
10305 __struct.width = buf.get_u16_le();
10306 __struct.height = buf.get_u16_le();
10307 __struct.packets = buf.get_u16_le();
10308 let tmp = buf.get_u8();
10309 __struct.mavtype =
10310 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10311 enum_type: "MavlinkDataStreamType",
10312 value: tmp as u64,
10313 })?;
10314 __struct.payload = buf.get_u8();
10315 __struct.jpg_quality = buf.get_u8();
10316 Ok(__struct)
10317 }
10318 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10319 let mut __tmp = BytesMut::new(bytes);
10320 #[allow(clippy::absurd_extreme_comparisons)]
10321 #[allow(unused_comparisons)]
10322 if __tmp.remaining() < Self::ENCODED_LEN {
10323 panic!(
10324 "buffer is too small (need {} bytes, but got {})",
10325 Self::ENCODED_LEN,
10326 __tmp.remaining(),
10327 )
10328 }
10329 __tmp.put_u32_le(self.size);
10330 __tmp.put_u16_le(self.width);
10331 __tmp.put_u16_le(self.height);
10332 __tmp.put_u16_le(self.packets);
10333 __tmp.put_u8(self.mavtype as u8);
10334 __tmp.put_u8(self.payload);
10335 __tmp.put_u8(self.jpg_quality);
10336 if matches!(version, MavlinkVersion::V2) {
10337 let len = __tmp.len();
10338 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10339 } else {
10340 __tmp.len()
10341 }
10342 }
10343}
10344#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10345#[doc = ""]
10346#[doc = "ID: 254"]
10347#[derive(Debug, Clone, PartialEq)]
10348#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10349#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10350#[cfg_attr(feature = "ts", derive(TS))]
10351#[cfg_attr(feature = "ts", ts(export))]
10352pub struct DEBUG_DATA {
10353 #[doc = "Timestamp (time since system boot)."]
10354 pub time_boot_ms: u32,
10355 #[doc = "DEBUG value"]
10356 pub value: f32,
10357 #[doc = "index of debug variable"]
10358 pub ind: u8,
10359}
10360impl DEBUG_DATA {
10361 pub const ENCODED_LEN: usize = 9usize;
10362 pub const DEFAULT: Self = Self {
10363 time_boot_ms: 0_u32,
10364 value: 0.0_f32,
10365 ind: 0_u8,
10366 };
10367 #[cfg(feature = "arbitrary")]
10368 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10369 use arbitrary::{Arbitrary, Unstructured};
10370 let mut buf = [0u8; 1024];
10371 rng.fill_bytes(&mut buf);
10372 let mut unstructured = Unstructured::new(&buf);
10373 Self::arbitrary(&mut unstructured).unwrap_or_default()
10374 }
10375}
10376impl Default for DEBUG_DATA {
10377 fn default() -> Self {
10378 Self::DEFAULT.clone()
10379 }
10380}
10381impl MessageData for DEBUG_DATA {
10382 type Message = MavMessage;
10383 const ID: u32 = 254u32;
10384 const NAME: &'static str = "DEBUG";
10385 const EXTRA_CRC: u8 = 46u8;
10386 const ENCODED_LEN: usize = 9usize;
10387 fn deser(
10388 _version: MavlinkVersion,
10389 __input: &[u8],
10390 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10391 let avail_len = __input.len();
10392 let mut payload_buf = [0; Self::ENCODED_LEN];
10393 let mut buf = if avail_len < Self::ENCODED_LEN {
10394 payload_buf[0..avail_len].copy_from_slice(__input);
10395 Bytes::new(&payload_buf)
10396 } else {
10397 Bytes::new(__input)
10398 };
10399 let mut __struct = Self::default();
10400 __struct.time_boot_ms = buf.get_u32_le();
10401 __struct.value = buf.get_f32_le();
10402 __struct.ind = buf.get_u8();
10403 Ok(__struct)
10404 }
10405 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10406 let mut __tmp = BytesMut::new(bytes);
10407 #[allow(clippy::absurd_extreme_comparisons)]
10408 #[allow(unused_comparisons)]
10409 if __tmp.remaining() < Self::ENCODED_LEN {
10410 panic!(
10411 "buffer is too small (need {} bytes, but got {})",
10412 Self::ENCODED_LEN,
10413 __tmp.remaining(),
10414 )
10415 }
10416 __tmp.put_u32_le(self.time_boot_ms);
10417 __tmp.put_f32_le(self.value);
10418 __tmp.put_u8(self.ind);
10419 if matches!(version, MavlinkVersion::V2) {
10420 let len = __tmp.len();
10421 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10422 } else {
10423 __tmp.len()
10424 }
10425 }
10426}
10427#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10428#[doc = ""]
10429#[doc = "ID: 350"]
10430#[derive(Debug, Clone, PartialEq)]
10431#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10432#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10433#[cfg_attr(feature = "ts", derive(TS))]
10434#[cfg_attr(feature = "ts", ts(export))]
10435pub struct DEBUG_FLOAT_ARRAY_DATA {
10436 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10437 pub time_usec: u64,
10438 #[doc = "Unique ID used to discriminate between arrays"]
10439 pub array_id: u16,
10440 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10441 #[cfg_attr(feature = "ts", ts(type = "string"))]
10442 pub name: CharArray<10>,
10443 #[doc = "data"]
10444 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10445 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10446 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10447 pub data: [f32; 58],
10448}
10449impl DEBUG_FLOAT_ARRAY_DATA {
10450 pub const ENCODED_LEN: usize = 252usize;
10451 pub const DEFAULT: Self = Self {
10452 time_usec: 0_u64,
10453 array_id: 0_u16,
10454 name: CharArray::new([0_u8; 10usize]),
10455 data: [0.0_f32; 58usize],
10456 };
10457 #[cfg(feature = "arbitrary")]
10458 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10459 use arbitrary::{Arbitrary, Unstructured};
10460 let mut buf = [0u8; 1024];
10461 rng.fill_bytes(&mut buf);
10462 let mut unstructured = Unstructured::new(&buf);
10463 Self::arbitrary(&mut unstructured).unwrap_or_default()
10464 }
10465}
10466impl Default for DEBUG_FLOAT_ARRAY_DATA {
10467 fn default() -> Self {
10468 Self::DEFAULT.clone()
10469 }
10470}
10471impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10472 type Message = MavMessage;
10473 const ID: u32 = 350u32;
10474 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10475 const EXTRA_CRC: u8 = 232u8;
10476 const ENCODED_LEN: usize = 252usize;
10477 fn deser(
10478 _version: MavlinkVersion,
10479 __input: &[u8],
10480 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10481 let avail_len = __input.len();
10482 let mut payload_buf = [0; Self::ENCODED_LEN];
10483 let mut buf = if avail_len < Self::ENCODED_LEN {
10484 payload_buf[0..avail_len].copy_from_slice(__input);
10485 Bytes::new(&payload_buf)
10486 } else {
10487 Bytes::new(__input)
10488 };
10489 let mut __struct = Self::default();
10490 __struct.time_usec = buf.get_u64_le();
10491 __struct.array_id = buf.get_u16_le();
10492 let mut tmp = [0_u8; 10usize];
10493 for v in &mut tmp {
10494 *v = buf.get_u8();
10495 }
10496 __struct.name = CharArray::new(tmp);
10497 for v in &mut __struct.data {
10498 let val = buf.get_f32_le();
10499 *v = val;
10500 }
10501 Ok(__struct)
10502 }
10503 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10504 let mut __tmp = BytesMut::new(bytes);
10505 #[allow(clippy::absurd_extreme_comparisons)]
10506 #[allow(unused_comparisons)]
10507 if __tmp.remaining() < Self::ENCODED_LEN {
10508 panic!(
10509 "buffer is too small (need {} bytes, but got {})",
10510 Self::ENCODED_LEN,
10511 __tmp.remaining(),
10512 )
10513 }
10514 __tmp.put_u64_le(self.time_usec);
10515 __tmp.put_u16_le(self.array_id);
10516 for val in &self.name {
10517 __tmp.put_u8(*val);
10518 }
10519 if matches!(version, MavlinkVersion::V2) {
10520 for val in &self.data {
10521 __tmp.put_f32_le(*val);
10522 }
10523 let len = __tmp.len();
10524 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10525 } else {
10526 __tmp.len()
10527 }
10528 }
10529}
10530#[doc = "To debug something using a named 3D vector."]
10531#[doc = ""]
10532#[doc = "ID: 250"]
10533#[derive(Debug, Clone, PartialEq)]
10534#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10535#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10536#[cfg_attr(feature = "ts", derive(TS))]
10537#[cfg_attr(feature = "ts", ts(export))]
10538pub struct DEBUG_VECT_DATA {
10539 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10540 pub time_usec: u64,
10541 #[doc = "x"]
10542 pub x: f32,
10543 #[doc = "y"]
10544 pub y: f32,
10545 #[doc = "z"]
10546 pub z: f32,
10547 #[doc = "Name"]
10548 #[cfg_attr(feature = "ts", ts(type = "string"))]
10549 pub name: CharArray<10>,
10550}
10551impl DEBUG_VECT_DATA {
10552 pub const ENCODED_LEN: usize = 30usize;
10553 pub const DEFAULT: Self = Self {
10554 time_usec: 0_u64,
10555 x: 0.0_f32,
10556 y: 0.0_f32,
10557 z: 0.0_f32,
10558 name: CharArray::new([0_u8; 10usize]),
10559 };
10560 #[cfg(feature = "arbitrary")]
10561 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10562 use arbitrary::{Arbitrary, Unstructured};
10563 let mut buf = [0u8; 1024];
10564 rng.fill_bytes(&mut buf);
10565 let mut unstructured = Unstructured::new(&buf);
10566 Self::arbitrary(&mut unstructured).unwrap_or_default()
10567 }
10568}
10569impl Default for DEBUG_VECT_DATA {
10570 fn default() -> Self {
10571 Self::DEFAULT.clone()
10572 }
10573}
10574impl MessageData for DEBUG_VECT_DATA {
10575 type Message = MavMessage;
10576 const ID: u32 = 250u32;
10577 const NAME: &'static str = "DEBUG_VECT";
10578 const EXTRA_CRC: u8 = 49u8;
10579 const ENCODED_LEN: usize = 30usize;
10580 fn deser(
10581 _version: MavlinkVersion,
10582 __input: &[u8],
10583 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10584 let avail_len = __input.len();
10585 let mut payload_buf = [0; Self::ENCODED_LEN];
10586 let mut buf = if avail_len < Self::ENCODED_LEN {
10587 payload_buf[0..avail_len].copy_from_slice(__input);
10588 Bytes::new(&payload_buf)
10589 } else {
10590 Bytes::new(__input)
10591 };
10592 let mut __struct = Self::default();
10593 __struct.time_usec = buf.get_u64_le();
10594 __struct.x = buf.get_f32_le();
10595 __struct.y = buf.get_f32_le();
10596 __struct.z = buf.get_f32_le();
10597 let mut tmp = [0_u8; 10usize];
10598 for v in &mut tmp {
10599 *v = buf.get_u8();
10600 }
10601 __struct.name = CharArray::new(tmp);
10602 Ok(__struct)
10603 }
10604 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10605 let mut __tmp = BytesMut::new(bytes);
10606 #[allow(clippy::absurd_extreme_comparisons)]
10607 #[allow(unused_comparisons)]
10608 if __tmp.remaining() < Self::ENCODED_LEN {
10609 panic!(
10610 "buffer is too small (need {} bytes, but got {})",
10611 Self::ENCODED_LEN,
10612 __tmp.remaining(),
10613 )
10614 }
10615 __tmp.put_u64_le(self.time_usec);
10616 __tmp.put_f32_le(self.x);
10617 __tmp.put_f32_le(self.y);
10618 __tmp.put_f32_le(self.z);
10619 for val in &self.name {
10620 __tmp.put_u8(*val);
10621 }
10622 if matches!(version, MavlinkVersion::V2) {
10623 let len = __tmp.len();
10624 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10625 } else {
10626 __tmp.len()
10627 }
10628 }
10629}
10630#[doc = "Distance sensor information for an onboard rangefinder."]
10631#[doc = ""]
10632#[doc = "ID: 132"]
10633#[derive(Debug, Clone, PartialEq)]
10634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10635#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10636#[cfg_attr(feature = "ts", derive(TS))]
10637#[cfg_attr(feature = "ts", ts(export))]
10638pub struct DISTANCE_SENSOR_DATA {
10639 #[doc = "Timestamp (time since system boot)."]
10640 pub time_boot_ms: u32,
10641 #[doc = "Minimum distance the sensor can measure"]
10642 pub min_distance: u16,
10643 #[doc = "Maximum distance the sensor can measure"]
10644 pub max_distance: u16,
10645 #[doc = "Current distance reading"]
10646 pub current_distance: u16,
10647 #[doc = "Type of distance sensor."]
10648 pub mavtype: MavDistanceSensor,
10649 #[doc = "Onboard ID of the sensor"]
10650 pub id: u8,
10651 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10652 pub orientation: MavSensorOrientation,
10653 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10654 pub covariance: u8,
10655 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10656 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10657 pub horizontal_fov: f32,
10658 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10659 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10660 pub vertical_fov: f32,
10661 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10662 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10663 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10664 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10665 pub quaternion: [f32; 4],
10666 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10667 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10668 pub signal_quality: u8,
10669}
10670impl DISTANCE_SENSOR_DATA {
10671 pub const ENCODED_LEN: usize = 39usize;
10672 pub const DEFAULT: Self = Self {
10673 time_boot_ms: 0_u32,
10674 min_distance: 0_u16,
10675 max_distance: 0_u16,
10676 current_distance: 0_u16,
10677 mavtype: MavDistanceSensor::DEFAULT,
10678 id: 0_u8,
10679 orientation: MavSensorOrientation::DEFAULT,
10680 covariance: 0_u8,
10681 horizontal_fov: 0.0_f32,
10682 vertical_fov: 0.0_f32,
10683 quaternion: [0.0_f32; 4usize],
10684 signal_quality: 0_u8,
10685 };
10686 #[cfg(feature = "arbitrary")]
10687 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10688 use arbitrary::{Arbitrary, Unstructured};
10689 let mut buf = [0u8; 1024];
10690 rng.fill_bytes(&mut buf);
10691 let mut unstructured = Unstructured::new(&buf);
10692 Self::arbitrary(&mut unstructured).unwrap_or_default()
10693 }
10694}
10695impl Default for DISTANCE_SENSOR_DATA {
10696 fn default() -> Self {
10697 Self::DEFAULT.clone()
10698 }
10699}
10700impl MessageData for DISTANCE_SENSOR_DATA {
10701 type Message = MavMessage;
10702 const ID: u32 = 132u32;
10703 const NAME: &'static str = "DISTANCE_SENSOR";
10704 const EXTRA_CRC: u8 = 85u8;
10705 const ENCODED_LEN: usize = 39usize;
10706 fn deser(
10707 _version: MavlinkVersion,
10708 __input: &[u8],
10709 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10710 let avail_len = __input.len();
10711 let mut payload_buf = [0; Self::ENCODED_LEN];
10712 let mut buf = if avail_len < Self::ENCODED_LEN {
10713 payload_buf[0..avail_len].copy_from_slice(__input);
10714 Bytes::new(&payload_buf)
10715 } else {
10716 Bytes::new(__input)
10717 };
10718 let mut __struct = Self::default();
10719 __struct.time_boot_ms = buf.get_u32_le();
10720 __struct.min_distance = buf.get_u16_le();
10721 __struct.max_distance = buf.get_u16_le();
10722 __struct.current_distance = buf.get_u16_le();
10723 let tmp = buf.get_u8();
10724 __struct.mavtype =
10725 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10726 enum_type: "MavDistanceSensor",
10727 value: tmp as u64,
10728 })?;
10729 __struct.id = buf.get_u8();
10730 let tmp = buf.get_u8();
10731 __struct.orientation =
10732 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10733 enum_type: "MavSensorOrientation",
10734 value: tmp as u64,
10735 })?;
10736 __struct.covariance = buf.get_u8();
10737 __struct.horizontal_fov = buf.get_f32_le();
10738 __struct.vertical_fov = buf.get_f32_le();
10739 for v in &mut __struct.quaternion {
10740 let val = buf.get_f32_le();
10741 *v = val;
10742 }
10743 __struct.signal_quality = buf.get_u8();
10744 Ok(__struct)
10745 }
10746 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10747 let mut __tmp = BytesMut::new(bytes);
10748 #[allow(clippy::absurd_extreme_comparisons)]
10749 #[allow(unused_comparisons)]
10750 if __tmp.remaining() < Self::ENCODED_LEN {
10751 panic!(
10752 "buffer is too small (need {} bytes, but got {})",
10753 Self::ENCODED_LEN,
10754 __tmp.remaining(),
10755 )
10756 }
10757 __tmp.put_u32_le(self.time_boot_ms);
10758 __tmp.put_u16_le(self.min_distance);
10759 __tmp.put_u16_le(self.max_distance);
10760 __tmp.put_u16_le(self.current_distance);
10761 __tmp.put_u8(self.mavtype as u8);
10762 __tmp.put_u8(self.id);
10763 __tmp.put_u8(self.orientation as u8);
10764 __tmp.put_u8(self.covariance);
10765 if matches!(version, MavlinkVersion::V2) {
10766 __tmp.put_f32_le(self.horizontal_fov);
10767 __tmp.put_f32_le(self.vertical_fov);
10768 for val in &self.quaternion {
10769 __tmp.put_f32_le(*val);
10770 }
10771 __tmp.put_u8(self.signal_quality);
10772 let len = __tmp.len();
10773 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10774 } else {
10775 __tmp.len()
10776 }
10777 }
10778}
10779#[doc = "EFI status output."]
10780#[doc = ""]
10781#[doc = "ID: 225"]
10782#[derive(Debug, Clone, PartialEq)]
10783#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10784#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10785#[cfg_attr(feature = "ts", derive(TS))]
10786#[cfg_attr(feature = "ts", ts(export))]
10787pub struct EFI_STATUS_DATA {
10788 #[doc = "ECU index"]
10789 pub ecu_index: f32,
10790 #[doc = "RPM"]
10791 pub rpm: f32,
10792 #[doc = "Fuel consumed"]
10793 pub fuel_consumed: f32,
10794 #[doc = "Fuel flow rate"]
10795 pub fuel_flow: f32,
10796 #[doc = "Engine load"]
10797 pub engine_load: f32,
10798 #[doc = "Throttle position"]
10799 pub throttle_position: f32,
10800 #[doc = "Spark dwell time"]
10801 pub spark_dwell_time: f32,
10802 #[doc = "Barometric pressure"]
10803 pub barometric_pressure: f32,
10804 #[doc = "Intake manifold pressure("]
10805 pub intake_manifold_pressure: f32,
10806 #[doc = "Intake manifold temperature"]
10807 pub intake_manifold_temperature: f32,
10808 #[doc = "Cylinder head temperature"]
10809 pub cylinder_head_temperature: f32,
10810 #[doc = "Ignition timing (Crank angle degrees)"]
10811 pub ignition_timing: f32,
10812 #[doc = "Injection time"]
10813 pub injection_time: f32,
10814 #[doc = "Exhaust gas temperature"]
10815 pub exhaust_gas_temperature: f32,
10816 #[doc = "Output throttle"]
10817 pub throttle_out: f32,
10818 #[doc = "Pressure/temperature compensation"]
10819 pub pt_compensation: f32,
10820 #[doc = "EFI health status"]
10821 pub health: u8,
10822 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10823 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10824 pub ignition_voltage: f32,
10825 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10826 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10827 pub fuel_pressure: f32,
10828}
10829impl EFI_STATUS_DATA {
10830 pub const ENCODED_LEN: usize = 73usize;
10831 pub const DEFAULT: Self = Self {
10832 ecu_index: 0.0_f32,
10833 rpm: 0.0_f32,
10834 fuel_consumed: 0.0_f32,
10835 fuel_flow: 0.0_f32,
10836 engine_load: 0.0_f32,
10837 throttle_position: 0.0_f32,
10838 spark_dwell_time: 0.0_f32,
10839 barometric_pressure: 0.0_f32,
10840 intake_manifold_pressure: 0.0_f32,
10841 intake_manifold_temperature: 0.0_f32,
10842 cylinder_head_temperature: 0.0_f32,
10843 ignition_timing: 0.0_f32,
10844 injection_time: 0.0_f32,
10845 exhaust_gas_temperature: 0.0_f32,
10846 throttle_out: 0.0_f32,
10847 pt_compensation: 0.0_f32,
10848 health: 0_u8,
10849 ignition_voltage: 0.0_f32,
10850 fuel_pressure: 0.0_f32,
10851 };
10852 #[cfg(feature = "arbitrary")]
10853 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10854 use arbitrary::{Arbitrary, Unstructured};
10855 let mut buf = [0u8; 1024];
10856 rng.fill_bytes(&mut buf);
10857 let mut unstructured = Unstructured::new(&buf);
10858 Self::arbitrary(&mut unstructured).unwrap_or_default()
10859 }
10860}
10861impl Default for EFI_STATUS_DATA {
10862 fn default() -> Self {
10863 Self::DEFAULT.clone()
10864 }
10865}
10866impl MessageData for EFI_STATUS_DATA {
10867 type Message = MavMessage;
10868 const ID: u32 = 225u32;
10869 const NAME: &'static str = "EFI_STATUS";
10870 const EXTRA_CRC: u8 = 208u8;
10871 const ENCODED_LEN: usize = 73usize;
10872 fn deser(
10873 _version: MavlinkVersion,
10874 __input: &[u8],
10875 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10876 let avail_len = __input.len();
10877 let mut payload_buf = [0; Self::ENCODED_LEN];
10878 let mut buf = if avail_len < Self::ENCODED_LEN {
10879 payload_buf[0..avail_len].copy_from_slice(__input);
10880 Bytes::new(&payload_buf)
10881 } else {
10882 Bytes::new(__input)
10883 };
10884 let mut __struct = Self::default();
10885 __struct.ecu_index = buf.get_f32_le();
10886 __struct.rpm = buf.get_f32_le();
10887 __struct.fuel_consumed = buf.get_f32_le();
10888 __struct.fuel_flow = buf.get_f32_le();
10889 __struct.engine_load = buf.get_f32_le();
10890 __struct.throttle_position = buf.get_f32_le();
10891 __struct.spark_dwell_time = buf.get_f32_le();
10892 __struct.barometric_pressure = buf.get_f32_le();
10893 __struct.intake_manifold_pressure = buf.get_f32_le();
10894 __struct.intake_manifold_temperature = buf.get_f32_le();
10895 __struct.cylinder_head_temperature = buf.get_f32_le();
10896 __struct.ignition_timing = buf.get_f32_le();
10897 __struct.injection_time = buf.get_f32_le();
10898 __struct.exhaust_gas_temperature = buf.get_f32_le();
10899 __struct.throttle_out = buf.get_f32_le();
10900 __struct.pt_compensation = buf.get_f32_le();
10901 __struct.health = buf.get_u8();
10902 __struct.ignition_voltage = buf.get_f32_le();
10903 __struct.fuel_pressure = buf.get_f32_le();
10904 Ok(__struct)
10905 }
10906 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10907 let mut __tmp = BytesMut::new(bytes);
10908 #[allow(clippy::absurd_extreme_comparisons)]
10909 #[allow(unused_comparisons)]
10910 if __tmp.remaining() < Self::ENCODED_LEN {
10911 panic!(
10912 "buffer is too small (need {} bytes, but got {})",
10913 Self::ENCODED_LEN,
10914 __tmp.remaining(),
10915 )
10916 }
10917 __tmp.put_f32_le(self.ecu_index);
10918 __tmp.put_f32_le(self.rpm);
10919 __tmp.put_f32_le(self.fuel_consumed);
10920 __tmp.put_f32_le(self.fuel_flow);
10921 __tmp.put_f32_le(self.engine_load);
10922 __tmp.put_f32_le(self.throttle_position);
10923 __tmp.put_f32_le(self.spark_dwell_time);
10924 __tmp.put_f32_le(self.barometric_pressure);
10925 __tmp.put_f32_le(self.intake_manifold_pressure);
10926 __tmp.put_f32_le(self.intake_manifold_temperature);
10927 __tmp.put_f32_le(self.cylinder_head_temperature);
10928 __tmp.put_f32_le(self.ignition_timing);
10929 __tmp.put_f32_le(self.injection_time);
10930 __tmp.put_f32_le(self.exhaust_gas_temperature);
10931 __tmp.put_f32_le(self.throttle_out);
10932 __tmp.put_f32_le(self.pt_compensation);
10933 __tmp.put_u8(self.health);
10934 if matches!(version, MavlinkVersion::V2) {
10935 __tmp.put_f32_le(self.ignition_voltage);
10936 __tmp.put_f32_le(self.fuel_pressure);
10937 let len = __tmp.len();
10938 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10939 } else {
10940 __tmp.len()
10941 }
10942 }
10943}
10944#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10945#[doc = ""]
10946#[doc = "ID: 131"]
10947#[derive(Debug, Clone, PartialEq)]
10948#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10949#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10950#[cfg_attr(feature = "ts", derive(TS))]
10951#[cfg_attr(feature = "ts", ts(export))]
10952pub struct ENCAPSULATED_DATA_DATA {
10953 #[doc = "sequence number (starting with 0 on every transmission)"]
10954 pub seqnr: u16,
10955 #[doc = "image data bytes"]
10956 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10957 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10958 pub data: [u8; 253],
10959}
10960impl ENCAPSULATED_DATA_DATA {
10961 pub const ENCODED_LEN: usize = 255usize;
10962 pub const DEFAULT: Self = Self {
10963 seqnr: 0_u16,
10964 data: [0_u8; 253usize],
10965 };
10966 #[cfg(feature = "arbitrary")]
10967 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10968 use arbitrary::{Arbitrary, Unstructured};
10969 let mut buf = [0u8; 1024];
10970 rng.fill_bytes(&mut buf);
10971 let mut unstructured = Unstructured::new(&buf);
10972 Self::arbitrary(&mut unstructured).unwrap_or_default()
10973 }
10974}
10975impl Default for ENCAPSULATED_DATA_DATA {
10976 fn default() -> Self {
10977 Self::DEFAULT.clone()
10978 }
10979}
10980impl MessageData for ENCAPSULATED_DATA_DATA {
10981 type Message = MavMessage;
10982 const ID: u32 = 131u32;
10983 const NAME: &'static str = "ENCAPSULATED_DATA";
10984 const EXTRA_CRC: u8 = 223u8;
10985 const ENCODED_LEN: usize = 255usize;
10986 fn deser(
10987 _version: MavlinkVersion,
10988 __input: &[u8],
10989 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10990 let avail_len = __input.len();
10991 let mut payload_buf = [0; Self::ENCODED_LEN];
10992 let mut buf = if avail_len < Self::ENCODED_LEN {
10993 payload_buf[0..avail_len].copy_from_slice(__input);
10994 Bytes::new(&payload_buf)
10995 } else {
10996 Bytes::new(__input)
10997 };
10998 let mut __struct = Self::default();
10999 __struct.seqnr = buf.get_u16_le();
11000 for v in &mut __struct.data {
11001 let val = buf.get_u8();
11002 *v = val;
11003 }
11004 Ok(__struct)
11005 }
11006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11007 let mut __tmp = BytesMut::new(bytes);
11008 #[allow(clippy::absurd_extreme_comparisons)]
11009 #[allow(unused_comparisons)]
11010 if __tmp.remaining() < Self::ENCODED_LEN {
11011 panic!(
11012 "buffer is too small (need {} bytes, but got {})",
11013 Self::ENCODED_LEN,
11014 __tmp.remaining(),
11015 )
11016 }
11017 __tmp.put_u16_le(self.seqnr);
11018 for val in &self.data {
11019 __tmp.put_u8(*val);
11020 }
11021 if matches!(version, MavlinkVersion::V2) {
11022 let len = __tmp.len();
11023 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11024 } else {
11025 __tmp.len()
11026 }
11027 }
11028}
11029#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11030#[doc = ""]
11031#[doc = "ID: 290"]
11032#[derive(Debug, Clone, PartialEq)]
11033#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11035#[cfg_attr(feature = "ts", derive(TS))]
11036#[cfg_attr(feature = "ts", ts(export))]
11037pub struct ESC_INFO_DATA {
11038 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11039 pub time_usec: u64,
11040 #[doc = "Number of reported errors by each ESC since boot."]
11041 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11042 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11043 pub error_count: [u32; 4],
11044 #[doc = "Counter of data packets received."]
11045 pub counter: u16,
11046 #[doc = "Bitmap of ESC failure flags."]
11047 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11048 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11049 pub failure_flags: [u16; 4],
11050 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11051 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11052 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11053 pub temperature: [i16; 4],
11054 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11055 pub index: u8,
11056 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11057 pub count: u8,
11058 #[doc = "Connection type protocol for all ESC."]
11059 pub connection_type: EscConnectionType,
11060 #[doc = "Information regarding online/offline status of each ESC."]
11061 pub info: u8,
11062}
11063impl ESC_INFO_DATA {
11064 pub const ENCODED_LEN: usize = 46usize;
11065 pub const DEFAULT: Self = Self {
11066 time_usec: 0_u64,
11067 error_count: [0_u32; 4usize],
11068 counter: 0_u16,
11069 failure_flags: [0_u16; 4usize],
11070 temperature: [0_i16; 4usize],
11071 index: 0_u8,
11072 count: 0_u8,
11073 connection_type: EscConnectionType::DEFAULT,
11074 info: 0_u8,
11075 };
11076 #[cfg(feature = "arbitrary")]
11077 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11078 use arbitrary::{Arbitrary, Unstructured};
11079 let mut buf = [0u8; 1024];
11080 rng.fill_bytes(&mut buf);
11081 let mut unstructured = Unstructured::new(&buf);
11082 Self::arbitrary(&mut unstructured).unwrap_or_default()
11083 }
11084}
11085impl Default for ESC_INFO_DATA {
11086 fn default() -> Self {
11087 Self::DEFAULT.clone()
11088 }
11089}
11090impl MessageData for ESC_INFO_DATA {
11091 type Message = MavMessage;
11092 const ID: u32 = 290u32;
11093 const NAME: &'static str = "ESC_INFO";
11094 const EXTRA_CRC: u8 = 251u8;
11095 const ENCODED_LEN: usize = 46usize;
11096 fn deser(
11097 _version: MavlinkVersion,
11098 __input: &[u8],
11099 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11100 let avail_len = __input.len();
11101 let mut payload_buf = [0; Self::ENCODED_LEN];
11102 let mut buf = if avail_len < Self::ENCODED_LEN {
11103 payload_buf[0..avail_len].copy_from_slice(__input);
11104 Bytes::new(&payload_buf)
11105 } else {
11106 Bytes::new(__input)
11107 };
11108 let mut __struct = Self::default();
11109 __struct.time_usec = buf.get_u64_le();
11110 for v in &mut __struct.error_count {
11111 let val = buf.get_u32_le();
11112 *v = val;
11113 }
11114 __struct.counter = buf.get_u16_le();
11115 for v in &mut __struct.failure_flags {
11116 let val = buf.get_u16_le();
11117 *v = val;
11118 }
11119 for v in &mut __struct.temperature {
11120 let val = buf.get_i16_le();
11121 *v = val;
11122 }
11123 __struct.index = buf.get_u8();
11124 __struct.count = buf.get_u8();
11125 let tmp = buf.get_u8();
11126 __struct.connection_type =
11127 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11128 enum_type: "EscConnectionType",
11129 value: tmp as u64,
11130 })?;
11131 __struct.info = buf.get_u8();
11132 Ok(__struct)
11133 }
11134 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11135 let mut __tmp = BytesMut::new(bytes);
11136 #[allow(clippy::absurd_extreme_comparisons)]
11137 #[allow(unused_comparisons)]
11138 if __tmp.remaining() < Self::ENCODED_LEN {
11139 panic!(
11140 "buffer is too small (need {} bytes, but got {})",
11141 Self::ENCODED_LEN,
11142 __tmp.remaining(),
11143 )
11144 }
11145 __tmp.put_u64_le(self.time_usec);
11146 for val in &self.error_count {
11147 __tmp.put_u32_le(*val);
11148 }
11149 __tmp.put_u16_le(self.counter);
11150 for val in &self.failure_flags {
11151 __tmp.put_u16_le(*val);
11152 }
11153 for val in &self.temperature {
11154 __tmp.put_i16_le(*val);
11155 }
11156 __tmp.put_u8(self.index);
11157 __tmp.put_u8(self.count);
11158 __tmp.put_u8(self.connection_type as u8);
11159 __tmp.put_u8(self.info);
11160 if matches!(version, MavlinkVersion::V2) {
11161 let len = __tmp.len();
11162 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11163 } else {
11164 __tmp.len()
11165 }
11166 }
11167}
11168#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11169#[doc = ""]
11170#[doc = "ID: 291"]
11171#[derive(Debug, Clone, PartialEq)]
11172#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11173#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11174#[cfg_attr(feature = "ts", derive(TS))]
11175#[cfg_attr(feature = "ts", ts(export))]
11176pub struct ESC_STATUS_DATA {
11177 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11178 pub time_usec: u64,
11179 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11180 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11181 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11182 pub rpm: [i32; 4],
11183 #[doc = "Voltage measured from each ESC."]
11184 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11185 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11186 pub voltage: [f32; 4],
11187 #[doc = "Current measured from each ESC."]
11188 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11189 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11190 pub current: [f32; 4],
11191 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11192 pub index: u8,
11193}
11194impl ESC_STATUS_DATA {
11195 pub const ENCODED_LEN: usize = 57usize;
11196 pub const DEFAULT: Self = Self {
11197 time_usec: 0_u64,
11198 rpm: [0_i32; 4usize],
11199 voltage: [0.0_f32; 4usize],
11200 current: [0.0_f32; 4usize],
11201 index: 0_u8,
11202 };
11203 #[cfg(feature = "arbitrary")]
11204 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11205 use arbitrary::{Arbitrary, Unstructured};
11206 let mut buf = [0u8; 1024];
11207 rng.fill_bytes(&mut buf);
11208 let mut unstructured = Unstructured::new(&buf);
11209 Self::arbitrary(&mut unstructured).unwrap_or_default()
11210 }
11211}
11212impl Default for ESC_STATUS_DATA {
11213 fn default() -> Self {
11214 Self::DEFAULT.clone()
11215 }
11216}
11217impl MessageData for ESC_STATUS_DATA {
11218 type Message = MavMessage;
11219 const ID: u32 = 291u32;
11220 const NAME: &'static str = "ESC_STATUS";
11221 const EXTRA_CRC: u8 = 10u8;
11222 const ENCODED_LEN: usize = 57usize;
11223 fn deser(
11224 _version: MavlinkVersion,
11225 __input: &[u8],
11226 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11227 let avail_len = __input.len();
11228 let mut payload_buf = [0; Self::ENCODED_LEN];
11229 let mut buf = if avail_len < Self::ENCODED_LEN {
11230 payload_buf[0..avail_len].copy_from_slice(__input);
11231 Bytes::new(&payload_buf)
11232 } else {
11233 Bytes::new(__input)
11234 };
11235 let mut __struct = Self::default();
11236 __struct.time_usec = buf.get_u64_le();
11237 for v in &mut __struct.rpm {
11238 let val = buf.get_i32_le();
11239 *v = val;
11240 }
11241 for v in &mut __struct.voltage {
11242 let val = buf.get_f32_le();
11243 *v = val;
11244 }
11245 for v in &mut __struct.current {
11246 let val = buf.get_f32_le();
11247 *v = val;
11248 }
11249 __struct.index = buf.get_u8();
11250 Ok(__struct)
11251 }
11252 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11253 let mut __tmp = BytesMut::new(bytes);
11254 #[allow(clippy::absurd_extreme_comparisons)]
11255 #[allow(unused_comparisons)]
11256 if __tmp.remaining() < Self::ENCODED_LEN {
11257 panic!(
11258 "buffer is too small (need {} bytes, but got {})",
11259 Self::ENCODED_LEN,
11260 __tmp.remaining(),
11261 )
11262 }
11263 __tmp.put_u64_le(self.time_usec);
11264 for val in &self.rpm {
11265 __tmp.put_i32_le(*val);
11266 }
11267 for val in &self.voltage {
11268 __tmp.put_f32_le(*val);
11269 }
11270 for val in &self.current {
11271 __tmp.put_f32_le(*val);
11272 }
11273 __tmp.put_u8(self.index);
11274 if matches!(version, MavlinkVersion::V2) {
11275 let len = __tmp.len();
11276 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11277 } else {
11278 __tmp.len()
11279 }
11280 }
11281}
11282#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11283#[doc = ""]
11284#[doc = "ID: 230"]
11285#[derive(Debug, Clone, PartialEq)]
11286#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11288#[cfg_attr(feature = "ts", derive(TS))]
11289#[cfg_attr(feature = "ts", ts(export))]
11290pub struct ESTIMATOR_STATUS_DATA {
11291 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11292 pub time_usec: u64,
11293 #[doc = "Velocity innovation test ratio"]
11294 pub vel_ratio: f32,
11295 #[doc = "Horizontal position innovation test ratio"]
11296 pub pos_horiz_ratio: f32,
11297 #[doc = "Vertical position innovation test ratio"]
11298 pub pos_vert_ratio: f32,
11299 #[doc = "Magnetometer innovation test ratio"]
11300 pub mag_ratio: f32,
11301 #[doc = "Height above terrain innovation test ratio"]
11302 pub hagl_ratio: f32,
11303 #[doc = "True airspeed innovation test ratio"]
11304 pub tas_ratio: f32,
11305 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11306 pub pos_horiz_accuracy: f32,
11307 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11308 pub pos_vert_accuracy: f32,
11309 #[doc = "Bitmap indicating which EKF outputs are valid."]
11310 pub flags: EstimatorStatusFlags,
11311}
11312impl ESTIMATOR_STATUS_DATA {
11313 pub const ENCODED_LEN: usize = 42usize;
11314 pub const DEFAULT: Self = Self {
11315 time_usec: 0_u64,
11316 vel_ratio: 0.0_f32,
11317 pos_horiz_ratio: 0.0_f32,
11318 pos_vert_ratio: 0.0_f32,
11319 mag_ratio: 0.0_f32,
11320 hagl_ratio: 0.0_f32,
11321 tas_ratio: 0.0_f32,
11322 pos_horiz_accuracy: 0.0_f32,
11323 pos_vert_accuracy: 0.0_f32,
11324 flags: EstimatorStatusFlags::DEFAULT,
11325 };
11326 #[cfg(feature = "arbitrary")]
11327 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11328 use arbitrary::{Arbitrary, Unstructured};
11329 let mut buf = [0u8; 1024];
11330 rng.fill_bytes(&mut buf);
11331 let mut unstructured = Unstructured::new(&buf);
11332 Self::arbitrary(&mut unstructured).unwrap_or_default()
11333 }
11334}
11335impl Default for ESTIMATOR_STATUS_DATA {
11336 fn default() -> Self {
11337 Self::DEFAULT.clone()
11338 }
11339}
11340impl MessageData for ESTIMATOR_STATUS_DATA {
11341 type Message = MavMessage;
11342 const ID: u32 = 230u32;
11343 const NAME: &'static str = "ESTIMATOR_STATUS";
11344 const EXTRA_CRC: u8 = 163u8;
11345 const ENCODED_LEN: usize = 42usize;
11346 fn deser(
11347 _version: MavlinkVersion,
11348 __input: &[u8],
11349 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11350 let avail_len = __input.len();
11351 let mut payload_buf = [0; Self::ENCODED_LEN];
11352 let mut buf = if avail_len < Self::ENCODED_LEN {
11353 payload_buf[0..avail_len].copy_from_slice(__input);
11354 Bytes::new(&payload_buf)
11355 } else {
11356 Bytes::new(__input)
11357 };
11358 let mut __struct = Self::default();
11359 __struct.time_usec = buf.get_u64_le();
11360 __struct.vel_ratio = buf.get_f32_le();
11361 __struct.pos_horiz_ratio = buf.get_f32_le();
11362 __struct.pos_vert_ratio = buf.get_f32_le();
11363 __struct.mag_ratio = buf.get_f32_le();
11364 __struct.hagl_ratio = buf.get_f32_le();
11365 __struct.tas_ratio = buf.get_f32_le();
11366 __struct.pos_horiz_accuracy = buf.get_f32_le();
11367 __struct.pos_vert_accuracy = buf.get_f32_le();
11368 let tmp = buf.get_u16_le();
11369 __struct.flags = EstimatorStatusFlags::from_bits(
11370 tmp as <EstimatorStatusFlags as Flags>::Bits,
11371 )
11372 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11373 flag_type: "EstimatorStatusFlags",
11374 value: tmp as u64,
11375 })?;
11376 Ok(__struct)
11377 }
11378 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11379 let mut __tmp = BytesMut::new(bytes);
11380 #[allow(clippy::absurd_extreme_comparisons)]
11381 #[allow(unused_comparisons)]
11382 if __tmp.remaining() < Self::ENCODED_LEN {
11383 panic!(
11384 "buffer is too small (need {} bytes, but got {})",
11385 Self::ENCODED_LEN,
11386 __tmp.remaining(),
11387 )
11388 }
11389 __tmp.put_u64_le(self.time_usec);
11390 __tmp.put_f32_le(self.vel_ratio);
11391 __tmp.put_f32_le(self.pos_horiz_ratio);
11392 __tmp.put_f32_le(self.pos_vert_ratio);
11393 __tmp.put_f32_le(self.mag_ratio);
11394 __tmp.put_f32_le(self.hagl_ratio);
11395 __tmp.put_f32_le(self.tas_ratio);
11396 __tmp.put_f32_le(self.pos_horiz_accuracy);
11397 __tmp.put_f32_le(self.pos_vert_accuracy);
11398 __tmp.put_u16_le(self.flags.bits() as u16);
11399 if matches!(version, MavlinkVersion::V2) {
11400 let len = __tmp.len();
11401 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11402 } else {
11403 __tmp.len()
11404 }
11405 }
11406}
11407#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11408#[doc = ""]
11409#[doc = "ID: 410"]
11410#[derive(Debug, Clone, PartialEq)]
11411#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11412#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11413#[cfg_attr(feature = "ts", derive(TS))]
11414#[cfg_attr(feature = "ts", ts(export))]
11415pub struct EVENT_DATA {
11416 #[doc = "Event ID (as defined in the component metadata)"]
11417 pub id: u32,
11418 #[doc = "Timestamp (time since system boot when the event happened)."]
11419 pub event_time_boot_ms: u32,
11420 #[doc = "Sequence number."]
11421 pub sequence: u16,
11422 #[doc = "Component ID"]
11423 pub destination_component: u8,
11424 #[doc = "System ID"]
11425 pub destination_system: u8,
11426 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11427 pub log_levels: u8,
11428 #[doc = "Arguments (depend on event ID)."]
11429 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11430 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11431 pub arguments: [u8; 40],
11432}
11433impl EVENT_DATA {
11434 pub const ENCODED_LEN: usize = 53usize;
11435 pub const DEFAULT: Self = Self {
11436 id: 0_u32,
11437 event_time_boot_ms: 0_u32,
11438 sequence: 0_u16,
11439 destination_component: 0_u8,
11440 destination_system: 0_u8,
11441 log_levels: 0_u8,
11442 arguments: [0_u8; 40usize],
11443 };
11444 #[cfg(feature = "arbitrary")]
11445 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11446 use arbitrary::{Arbitrary, Unstructured};
11447 let mut buf = [0u8; 1024];
11448 rng.fill_bytes(&mut buf);
11449 let mut unstructured = Unstructured::new(&buf);
11450 Self::arbitrary(&mut unstructured).unwrap_or_default()
11451 }
11452}
11453impl Default for EVENT_DATA {
11454 fn default() -> Self {
11455 Self::DEFAULT.clone()
11456 }
11457}
11458impl MessageData for EVENT_DATA {
11459 type Message = MavMessage;
11460 const ID: u32 = 410u32;
11461 const NAME: &'static str = "EVENT";
11462 const EXTRA_CRC: u8 = 160u8;
11463 const ENCODED_LEN: usize = 53usize;
11464 fn deser(
11465 _version: MavlinkVersion,
11466 __input: &[u8],
11467 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11468 let avail_len = __input.len();
11469 let mut payload_buf = [0; Self::ENCODED_LEN];
11470 let mut buf = if avail_len < Self::ENCODED_LEN {
11471 payload_buf[0..avail_len].copy_from_slice(__input);
11472 Bytes::new(&payload_buf)
11473 } else {
11474 Bytes::new(__input)
11475 };
11476 let mut __struct = Self::default();
11477 __struct.id = buf.get_u32_le();
11478 __struct.event_time_boot_ms = buf.get_u32_le();
11479 __struct.sequence = buf.get_u16_le();
11480 __struct.destination_component = buf.get_u8();
11481 __struct.destination_system = buf.get_u8();
11482 __struct.log_levels = buf.get_u8();
11483 for v in &mut __struct.arguments {
11484 let val = buf.get_u8();
11485 *v = val;
11486 }
11487 Ok(__struct)
11488 }
11489 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11490 let mut __tmp = BytesMut::new(bytes);
11491 #[allow(clippy::absurd_extreme_comparisons)]
11492 #[allow(unused_comparisons)]
11493 if __tmp.remaining() < Self::ENCODED_LEN {
11494 panic!(
11495 "buffer is too small (need {} bytes, but got {})",
11496 Self::ENCODED_LEN,
11497 __tmp.remaining(),
11498 )
11499 }
11500 __tmp.put_u32_le(self.id);
11501 __tmp.put_u32_le(self.event_time_boot_ms);
11502 __tmp.put_u16_le(self.sequence);
11503 __tmp.put_u8(self.destination_component);
11504 __tmp.put_u8(self.destination_system);
11505 __tmp.put_u8(self.log_levels);
11506 for val in &self.arguments {
11507 __tmp.put_u8(*val);
11508 }
11509 if matches!(version, MavlinkVersion::V2) {
11510 let len = __tmp.len();
11511 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11512 } else {
11513 __tmp.len()
11514 }
11515 }
11516}
11517#[doc = "Provides state for additional features."]
11518#[doc = ""]
11519#[doc = "ID: 245"]
11520#[derive(Debug, Clone, PartialEq)]
11521#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11522#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11523#[cfg_attr(feature = "ts", derive(TS))]
11524#[cfg_attr(feature = "ts", ts(export))]
11525pub struct EXTENDED_SYS_STATE_DATA {
11526 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11527 pub vtol_state: MavVtolState,
11528 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11529 pub landed_state: MavLandedState,
11530}
11531impl EXTENDED_SYS_STATE_DATA {
11532 pub const ENCODED_LEN: usize = 2usize;
11533 pub const DEFAULT: Self = Self {
11534 vtol_state: MavVtolState::DEFAULT,
11535 landed_state: MavLandedState::DEFAULT,
11536 };
11537 #[cfg(feature = "arbitrary")]
11538 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11539 use arbitrary::{Arbitrary, Unstructured};
11540 let mut buf = [0u8; 1024];
11541 rng.fill_bytes(&mut buf);
11542 let mut unstructured = Unstructured::new(&buf);
11543 Self::arbitrary(&mut unstructured).unwrap_or_default()
11544 }
11545}
11546impl Default for EXTENDED_SYS_STATE_DATA {
11547 fn default() -> Self {
11548 Self::DEFAULT.clone()
11549 }
11550}
11551impl MessageData for EXTENDED_SYS_STATE_DATA {
11552 type Message = MavMessage;
11553 const ID: u32 = 245u32;
11554 const NAME: &'static str = "EXTENDED_SYS_STATE";
11555 const EXTRA_CRC: u8 = 130u8;
11556 const ENCODED_LEN: usize = 2usize;
11557 fn deser(
11558 _version: MavlinkVersion,
11559 __input: &[u8],
11560 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11561 let avail_len = __input.len();
11562 let mut payload_buf = [0; Self::ENCODED_LEN];
11563 let mut buf = if avail_len < Self::ENCODED_LEN {
11564 payload_buf[0..avail_len].copy_from_slice(__input);
11565 Bytes::new(&payload_buf)
11566 } else {
11567 Bytes::new(__input)
11568 };
11569 let mut __struct = Self::default();
11570 let tmp = buf.get_u8();
11571 __struct.vtol_state =
11572 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11573 enum_type: "MavVtolState",
11574 value: tmp as u64,
11575 })?;
11576 let tmp = buf.get_u8();
11577 __struct.landed_state =
11578 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11579 enum_type: "MavLandedState",
11580 value: tmp as u64,
11581 })?;
11582 Ok(__struct)
11583 }
11584 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11585 let mut __tmp = BytesMut::new(bytes);
11586 #[allow(clippy::absurd_extreme_comparisons)]
11587 #[allow(unused_comparisons)]
11588 if __tmp.remaining() < Self::ENCODED_LEN {
11589 panic!(
11590 "buffer is too small (need {} bytes, but got {})",
11591 Self::ENCODED_LEN,
11592 __tmp.remaining(),
11593 )
11594 }
11595 __tmp.put_u8(self.vtol_state as u8);
11596 __tmp.put_u8(self.landed_state as u8);
11597 if matches!(version, MavlinkVersion::V2) {
11598 let len = __tmp.len();
11599 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11600 } else {
11601 __tmp.len()
11602 }
11603 }
11604}
11605#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11606#[doc = ""]
11607#[doc = "ID: 162"]
11608#[derive(Debug, Clone, PartialEq)]
11609#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11611#[cfg_attr(feature = "ts", derive(TS))]
11612#[cfg_attr(feature = "ts", ts(export))]
11613pub struct FENCE_STATUS_DATA {
11614 #[doc = "Time (since boot) of last breach."]
11615 pub breach_time: u32,
11616 #[doc = "Number of fence breaches."]
11617 pub breach_count: u16,
11618 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11619 pub breach_status: u8,
11620 #[doc = "Last breach type."]
11621 pub breach_type: FenceBreach,
11622 #[doc = "Active action to prevent fence breach"]
11623 #[cfg_attr(feature = "serde", serde(default))]
11624 pub breach_mitigation: FenceMitigate,
11625}
11626impl FENCE_STATUS_DATA {
11627 pub const ENCODED_LEN: usize = 9usize;
11628 pub const DEFAULT: Self = Self {
11629 breach_time: 0_u32,
11630 breach_count: 0_u16,
11631 breach_status: 0_u8,
11632 breach_type: FenceBreach::DEFAULT,
11633 breach_mitigation: FenceMitigate::DEFAULT,
11634 };
11635 #[cfg(feature = "arbitrary")]
11636 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11637 use arbitrary::{Arbitrary, Unstructured};
11638 let mut buf = [0u8; 1024];
11639 rng.fill_bytes(&mut buf);
11640 let mut unstructured = Unstructured::new(&buf);
11641 Self::arbitrary(&mut unstructured).unwrap_or_default()
11642 }
11643}
11644impl Default for FENCE_STATUS_DATA {
11645 fn default() -> Self {
11646 Self::DEFAULT.clone()
11647 }
11648}
11649impl MessageData for FENCE_STATUS_DATA {
11650 type Message = MavMessage;
11651 const ID: u32 = 162u32;
11652 const NAME: &'static str = "FENCE_STATUS";
11653 const EXTRA_CRC: u8 = 189u8;
11654 const ENCODED_LEN: usize = 9usize;
11655 fn deser(
11656 _version: MavlinkVersion,
11657 __input: &[u8],
11658 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11659 let avail_len = __input.len();
11660 let mut payload_buf = [0; Self::ENCODED_LEN];
11661 let mut buf = if avail_len < Self::ENCODED_LEN {
11662 payload_buf[0..avail_len].copy_from_slice(__input);
11663 Bytes::new(&payload_buf)
11664 } else {
11665 Bytes::new(__input)
11666 };
11667 let mut __struct = Self::default();
11668 __struct.breach_time = buf.get_u32_le();
11669 __struct.breach_count = buf.get_u16_le();
11670 __struct.breach_status = buf.get_u8();
11671 let tmp = buf.get_u8();
11672 __struct.breach_type =
11673 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11674 enum_type: "FenceBreach",
11675 value: tmp as u64,
11676 })?;
11677 let tmp = buf.get_u8();
11678 __struct.breach_mitigation =
11679 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11680 enum_type: "FenceMitigate",
11681 value: tmp as u64,
11682 })?;
11683 Ok(__struct)
11684 }
11685 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11686 let mut __tmp = BytesMut::new(bytes);
11687 #[allow(clippy::absurd_extreme_comparisons)]
11688 #[allow(unused_comparisons)]
11689 if __tmp.remaining() < Self::ENCODED_LEN {
11690 panic!(
11691 "buffer is too small (need {} bytes, but got {})",
11692 Self::ENCODED_LEN,
11693 __tmp.remaining(),
11694 )
11695 }
11696 __tmp.put_u32_le(self.breach_time);
11697 __tmp.put_u16_le(self.breach_count);
11698 __tmp.put_u8(self.breach_status);
11699 __tmp.put_u8(self.breach_type as u8);
11700 if matches!(version, MavlinkVersion::V2) {
11701 __tmp.put_u8(self.breach_mitigation as u8);
11702 let len = __tmp.len();
11703 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11704 } else {
11705 __tmp.len()
11706 }
11707 }
11708}
11709#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11710#[doc = ""]
11711#[doc = "ID: 110"]
11712#[derive(Debug, Clone, PartialEq)]
11713#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11714#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11715#[cfg_attr(feature = "ts", derive(TS))]
11716#[cfg_attr(feature = "ts", ts(export))]
11717pub struct FILE_TRANSFER_PROTOCOL_DATA {
11718 #[doc = "Network ID (0 for broadcast)"]
11719 pub target_network: u8,
11720 #[doc = "System ID (0 for broadcast)"]
11721 pub target_system: u8,
11722 #[doc = "Component ID (0 for broadcast)"]
11723 pub target_component: u8,
11724 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11725 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11726 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11727 pub payload: [u8; 251],
11728}
11729impl FILE_TRANSFER_PROTOCOL_DATA {
11730 pub const ENCODED_LEN: usize = 254usize;
11731 pub const DEFAULT: Self = Self {
11732 target_network: 0_u8,
11733 target_system: 0_u8,
11734 target_component: 0_u8,
11735 payload: [0_u8; 251usize],
11736 };
11737 #[cfg(feature = "arbitrary")]
11738 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11739 use arbitrary::{Arbitrary, Unstructured};
11740 let mut buf = [0u8; 1024];
11741 rng.fill_bytes(&mut buf);
11742 let mut unstructured = Unstructured::new(&buf);
11743 Self::arbitrary(&mut unstructured).unwrap_or_default()
11744 }
11745}
11746impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11747 fn default() -> Self {
11748 Self::DEFAULT.clone()
11749 }
11750}
11751impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11752 type Message = MavMessage;
11753 const ID: u32 = 110u32;
11754 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11755 const EXTRA_CRC: u8 = 84u8;
11756 const ENCODED_LEN: usize = 254usize;
11757 fn deser(
11758 _version: MavlinkVersion,
11759 __input: &[u8],
11760 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11761 let avail_len = __input.len();
11762 let mut payload_buf = [0; Self::ENCODED_LEN];
11763 let mut buf = if avail_len < Self::ENCODED_LEN {
11764 payload_buf[0..avail_len].copy_from_slice(__input);
11765 Bytes::new(&payload_buf)
11766 } else {
11767 Bytes::new(__input)
11768 };
11769 let mut __struct = Self::default();
11770 __struct.target_network = buf.get_u8();
11771 __struct.target_system = buf.get_u8();
11772 __struct.target_component = buf.get_u8();
11773 for v in &mut __struct.payload {
11774 let val = buf.get_u8();
11775 *v = val;
11776 }
11777 Ok(__struct)
11778 }
11779 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11780 let mut __tmp = BytesMut::new(bytes);
11781 #[allow(clippy::absurd_extreme_comparisons)]
11782 #[allow(unused_comparisons)]
11783 if __tmp.remaining() < Self::ENCODED_LEN {
11784 panic!(
11785 "buffer is too small (need {} bytes, but got {})",
11786 Self::ENCODED_LEN,
11787 __tmp.remaining(),
11788 )
11789 }
11790 __tmp.put_u8(self.target_network);
11791 __tmp.put_u8(self.target_system);
11792 __tmp.put_u8(self.target_component);
11793 for val in &self.payload {
11794 __tmp.put_u8(*val);
11795 }
11796 if matches!(version, MavlinkVersion::V2) {
11797 let len = __tmp.len();
11798 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11799 } else {
11800 __tmp.len()
11801 }
11802 }
11803}
11804#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11805#[doc = ""]
11806#[doc = "ID: 264"]
11807#[derive(Debug, Clone, PartialEq)]
11808#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11809#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11810#[cfg_attr(feature = "ts", derive(TS))]
11811#[cfg_attr(feature = "ts", ts(export))]
11812pub struct FLIGHT_INFORMATION_DATA {
11813 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11814 pub arming_time_utc: u64,
11815 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11816 pub takeoff_time_utc: u64,
11817 #[doc = "Flight number. Note, field is misnamed UUID."]
11818 pub flight_uuid: u64,
11819 #[doc = "Timestamp (time since system boot)."]
11820 pub time_boot_ms: u32,
11821 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11822 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11823 pub landing_time: u32,
11824}
11825impl FLIGHT_INFORMATION_DATA {
11826 pub const ENCODED_LEN: usize = 32usize;
11827 pub const DEFAULT: Self = Self {
11828 arming_time_utc: 0_u64,
11829 takeoff_time_utc: 0_u64,
11830 flight_uuid: 0_u64,
11831 time_boot_ms: 0_u32,
11832 landing_time: 0_u32,
11833 };
11834 #[cfg(feature = "arbitrary")]
11835 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11836 use arbitrary::{Arbitrary, Unstructured};
11837 let mut buf = [0u8; 1024];
11838 rng.fill_bytes(&mut buf);
11839 let mut unstructured = Unstructured::new(&buf);
11840 Self::arbitrary(&mut unstructured).unwrap_or_default()
11841 }
11842}
11843impl Default for FLIGHT_INFORMATION_DATA {
11844 fn default() -> Self {
11845 Self::DEFAULT.clone()
11846 }
11847}
11848impl MessageData for FLIGHT_INFORMATION_DATA {
11849 type Message = MavMessage;
11850 const ID: u32 = 264u32;
11851 const NAME: &'static str = "FLIGHT_INFORMATION";
11852 const EXTRA_CRC: u8 = 49u8;
11853 const ENCODED_LEN: usize = 32usize;
11854 fn deser(
11855 _version: MavlinkVersion,
11856 __input: &[u8],
11857 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11858 let avail_len = __input.len();
11859 let mut payload_buf = [0; Self::ENCODED_LEN];
11860 let mut buf = if avail_len < Self::ENCODED_LEN {
11861 payload_buf[0..avail_len].copy_from_slice(__input);
11862 Bytes::new(&payload_buf)
11863 } else {
11864 Bytes::new(__input)
11865 };
11866 let mut __struct = Self::default();
11867 __struct.arming_time_utc = buf.get_u64_le();
11868 __struct.takeoff_time_utc = buf.get_u64_le();
11869 __struct.flight_uuid = buf.get_u64_le();
11870 __struct.time_boot_ms = buf.get_u32_le();
11871 __struct.landing_time = buf.get_u32_le();
11872 Ok(__struct)
11873 }
11874 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11875 let mut __tmp = BytesMut::new(bytes);
11876 #[allow(clippy::absurd_extreme_comparisons)]
11877 #[allow(unused_comparisons)]
11878 if __tmp.remaining() < Self::ENCODED_LEN {
11879 panic!(
11880 "buffer is too small (need {} bytes, but got {})",
11881 Self::ENCODED_LEN,
11882 __tmp.remaining(),
11883 )
11884 }
11885 __tmp.put_u64_le(self.arming_time_utc);
11886 __tmp.put_u64_le(self.takeoff_time_utc);
11887 __tmp.put_u64_le(self.flight_uuid);
11888 __tmp.put_u32_le(self.time_boot_ms);
11889 if matches!(version, MavlinkVersion::V2) {
11890 __tmp.put_u32_le(self.landing_time);
11891 let len = __tmp.len();
11892 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11893 } else {
11894 __tmp.len()
11895 }
11896 }
11897}
11898#[doc = "Current motion information from a designated system."]
11899#[doc = ""]
11900#[doc = "ID: 144"]
11901#[derive(Debug, Clone, PartialEq)]
11902#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11903#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11904#[cfg_attr(feature = "ts", derive(TS))]
11905#[cfg_attr(feature = "ts", ts(export))]
11906pub struct FOLLOW_TARGET_DATA {
11907 #[doc = "Timestamp (time since system boot)."]
11908 pub timestamp: u64,
11909 #[doc = "button states or switches of a tracker device"]
11910 pub custom_state: u64,
11911 #[doc = "Latitude (WGS84)"]
11912 pub lat: i32,
11913 #[doc = "Longitude (WGS84)"]
11914 pub lon: i32,
11915 #[doc = "Altitude (MSL)"]
11916 pub alt: f32,
11917 #[doc = "target velocity (0,0,0) for unknown"]
11918 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11919 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11920 pub vel: [f32; 3],
11921 #[doc = "linear target acceleration (0,0,0) for unknown"]
11922 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11923 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11924 pub acc: [f32; 3],
11925 #[doc = "(0 0 0 0 for unknown)"]
11926 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11927 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11928 pub attitude_q: [f32; 4],
11929 #[doc = "(0 0 0 for unknown)"]
11930 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11931 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11932 pub rates: [f32; 3],
11933 #[doc = "eph epv"]
11934 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11935 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11936 pub position_cov: [f32; 3],
11937 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
11938 pub est_capabilities: u8,
11939}
11940impl FOLLOW_TARGET_DATA {
11941 pub const ENCODED_LEN: usize = 93usize;
11942 pub const DEFAULT: Self = Self {
11943 timestamp: 0_u64,
11944 custom_state: 0_u64,
11945 lat: 0_i32,
11946 lon: 0_i32,
11947 alt: 0.0_f32,
11948 vel: [0.0_f32; 3usize],
11949 acc: [0.0_f32; 3usize],
11950 attitude_q: [0.0_f32; 4usize],
11951 rates: [0.0_f32; 3usize],
11952 position_cov: [0.0_f32; 3usize],
11953 est_capabilities: 0_u8,
11954 };
11955 #[cfg(feature = "arbitrary")]
11956 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11957 use arbitrary::{Arbitrary, Unstructured};
11958 let mut buf = [0u8; 1024];
11959 rng.fill_bytes(&mut buf);
11960 let mut unstructured = Unstructured::new(&buf);
11961 Self::arbitrary(&mut unstructured).unwrap_or_default()
11962 }
11963}
11964impl Default for FOLLOW_TARGET_DATA {
11965 fn default() -> Self {
11966 Self::DEFAULT.clone()
11967 }
11968}
11969impl MessageData for FOLLOW_TARGET_DATA {
11970 type Message = MavMessage;
11971 const ID: u32 = 144u32;
11972 const NAME: &'static str = "FOLLOW_TARGET";
11973 const EXTRA_CRC: u8 = 127u8;
11974 const ENCODED_LEN: usize = 93usize;
11975 fn deser(
11976 _version: MavlinkVersion,
11977 __input: &[u8],
11978 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11979 let avail_len = __input.len();
11980 let mut payload_buf = [0; Self::ENCODED_LEN];
11981 let mut buf = if avail_len < Self::ENCODED_LEN {
11982 payload_buf[0..avail_len].copy_from_slice(__input);
11983 Bytes::new(&payload_buf)
11984 } else {
11985 Bytes::new(__input)
11986 };
11987 let mut __struct = Self::default();
11988 __struct.timestamp = buf.get_u64_le();
11989 __struct.custom_state = buf.get_u64_le();
11990 __struct.lat = buf.get_i32_le();
11991 __struct.lon = buf.get_i32_le();
11992 __struct.alt = buf.get_f32_le();
11993 for v in &mut __struct.vel {
11994 let val = buf.get_f32_le();
11995 *v = val;
11996 }
11997 for v in &mut __struct.acc {
11998 let val = buf.get_f32_le();
11999 *v = val;
12000 }
12001 for v in &mut __struct.attitude_q {
12002 let val = buf.get_f32_le();
12003 *v = val;
12004 }
12005 for v in &mut __struct.rates {
12006 let val = buf.get_f32_le();
12007 *v = val;
12008 }
12009 for v in &mut __struct.position_cov {
12010 let val = buf.get_f32_le();
12011 *v = val;
12012 }
12013 __struct.est_capabilities = buf.get_u8();
12014 Ok(__struct)
12015 }
12016 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12017 let mut __tmp = BytesMut::new(bytes);
12018 #[allow(clippy::absurd_extreme_comparisons)]
12019 #[allow(unused_comparisons)]
12020 if __tmp.remaining() < Self::ENCODED_LEN {
12021 panic!(
12022 "buffer is too small (need {} bytes, but got {})",
12023 Self::ENCODED_LEN,
12024 __tmp.remaining(),
12025 )
12026 }
12027 __tmp.put_u64_le(self.timestamp);
12028 __tmp.put_u64_le(self.custom_state);
12029 __tmp.put_i32_le(self.lat);
12030 __tmp.put_i32_le(self.lon);
12031 __tmp.put_f32_le(self.alt);
12032 for val in &self.vel {
12033 __tmp.put_f32_le(*val);
12034 }
12035 for val in &self.acc {
12036 __tmp.put_f32_le(*val);
12037 }
12038 for val in &self.attitude_q {
12039 __tmp.put_f32_le(*val);
12040 }
12041 for val in &self.rates {
12042 __tmp.put_f32_le(*val);
12043 }
12044 for val in &self.position_cov {
12045 __tmp.put_f32_le(*val);
12046 }
12047 __tmp.put_u8(self.est_capabilities);
12048 if matches!(version, MavlinkVersion::V2) {
12049 let len = __tmp.len();
12050 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12051 } else {
12052 __tmp.len()
12053 }
12054 }
12055}
12056#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12057#[doc = ""]
12058#[doc = "ID: 371"]
12059#[derive(Debug, Clone, PartialEq)]
12060#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12061#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12062#[cfg_attr(feature = "ts", derive(TS))]
12063#[cfg_attr(feature = "ts", ts(export))]
12064pub struct FUEL_STATUS_DATA {
12065 #[doc = "Capacity when full. Must be provided."]
12066 pub maximum_fuel: f32,
12067 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12068 pub consumed_fuel: f32,
12069 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12070 pub remaining_fuel: f32,
12071 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12072 pub flow_rate: f32,
12073 #[doc = "Fuel temperature. NaN: field not provided."]
12074 pub temperature: f32,
12075 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12076 pub fuel_type: MavFuelType,
12077 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12078 pub id: u8,
12079 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12080 pub percent_remaining: u8,
12081}
12082impl FUEL_STATUS_DATA {
12083 pub const ENCODED_LEN: usize = 26usize;
12084 pub const DEFAULT: Self = Self {
12085 maximum_fuel: 0.0_f32,
12086 consumed_fuel: 0.0_f32,
12087 remaining_fuel: 0.0_f32,
12088 flow_rate: 0.0_f32,
12089 temperature: 0.0_f32,
12090 fuel_type: MavFuelType::DEFAULT,
12091 id: 0_u8,
12092 percent_remaining: 0_u8,
12093 };
12094 #[cfg(feature = "arbitrary")]
12095 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12096 use arbitrary::{Arbitrary, Unstructured};
12097 let mut buf = [0u8; 1024];
12098 rng.fill_bytes(&mut buf);
12099 let mut unstructured = Unstructured::new(&buf);
12100 Self::arbitrary(&mut unstructured).unwrap_or_default()
12101 }
12102}
12103impl Default for FUEL_STATUS_DATA {
12104 fn default() -> Self {
12105 Self::DEFAULT.clone()
12106 }
12107}
12108impl MessageData for FUEL_STATUS_DATA {
12109 type Message = MavMessage;
12110 const ID: u32 = 371u32;
12111 const NAME: &'static str = "FUEL_STATUS";
12112 const EXTRA_CRC: u8 = 10u8;
12113 const ENCODED_LEN: usize = 26usize;
12114 fn deser(
12115 _version: MavlinkVersion,
12116 __input: &[u8],
12117 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12118 let avail_len = __input.len();
12119 let mut payload_buf = [0; Self::ENCODED_LEN];
12120 let mut buf = if avail_len < Self::ENCODED_LEN {
12121 payload_buf[0..avail_len].copy_from_slice(__input);
12122 Bytes::new(&payload_buf)
12123 } else {
12124 Bytes::new(__input)
12125 };
12126 let mut __struct = Self::default();
12127 __struct.maximum_fuel = buf.get_f32_le();
12128 __struct.consumed_fuel = buf.get_f32_le();
12129 __struct.remaining_fuel = buf.get_f32_le();
12130 __struct.flow_rate = buf.get_f32_le();
12131 __struct.temperature = buf.get_f32_le();
12132 let tmp = buf.get_u32_le();
12133 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12134 ::mavlink_core::error::ParserError::InvalidEnum {
12135 enum_type: "MavFuelType",
12136 value: tmp as u64,
12137 },
12138 )?;
12139 __struct.id = buf.get_u8();
12140 __struct.percent_remaining = buf.get_u8();
12141 Ok(__struct)
12142 }
12143 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12144 let mut __tmp = BytesMut::new(bytes);
12145 #[allow(clippy::absurd_extreme_comparisons)]
12146 #[allow(unused_comparisons)]
12147 if __tmp.remaining() < Self::ENCODED_LEN {
12148 panic!(
12149 "buffer is too small (need {} bytes, but got {})",
12150 Self::ENCODED_LEN,
12151 __tmp.remaining(),
12152 )
12153 }
12154 __tmp.put_f32_le(self.maximum_fuel);
12155 __tmp.put_f32_le(self.consumed_fuel);
12156 __tmp.put_f32_le(self.remaining_fuel);
12157 __tmp.put_f32_le(self.flow_rate);
12158 __tmp.put_f32_le(self.temperature);
12159 __tmp.put_u32_le(self.fuel_type as u32);
12160 __tmp.put_u8(self.id);
12161 __tmp.put_u8(self.percent_remaining);
12162 if matches!(version, MavlinkVersion::V2) {
12163 let len = __tmp.len();
12164 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12165 } else {
12166 __tmp.len()
12167 }
12168 }
12169}
12170#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12171#[doc = ""]
12172#[doc = "ID: 373"]
12173#[derive(Debug, Clone, PartialEq)]
12174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12175#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12176#[cfg_attr(feature = "ts", derive(TS))]
12177#[cfg_attr(feature = "ts", ts(export))]
12178pub struct GENERATOR_STATUS_DATA {
12179 #[doc = "Status flags."]
12180 pub status: MavGeneratorStatusFlag,
12181 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12182 pub battery_current: f32,
12183 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12184 pub load_current: f32,
12185 #[doc = "The power being generated. NaN: field not provided"]
12186 pub power_generated: f32,
12187 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12188 pub bus_voltage: f32,
12189 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12190 pub bat_current_setpoint: f32,
12191 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12192 pub runtime: u32,
12193 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12194 pub time_until_maintenance: i32,
12195 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12196 pub generator_speed: u16,
12197 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12198 pub rectifier_temperature: i16,
12199 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12200 pub generator_temperature: i16,
12201}
12202impl GENERATOR_STATUS_DATA {
12203 pub const ENCODED_LEN: usize = 42usize;
12204 pub const DEFAULT: Self = Self {
12205 status: MavGeneratorStatusFlag::DEFAULT,
12206 battery_current: 0.0_f32,
12207 load_current: 0.0_f32,
12208 power_generated: 0.0_f32,
12209 bus_voltage: 0.0_f32,
12210 bat_current_setpoint: 0.0_f32,
12211 runtime: 0_u32,
12212 time_until_maintenance: 0_i32,
12213 generator_speed: 0_u16,
12214 rectifier_temperature: 0_i16,
12215 generator_temperature: 0_i16,
12216 };
12217 #[cfg(feature = "arbitrary")]
12218 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12219 use arbitrary::{Arbitrary, Unstructured};
12220 let mut buf = [0u8; 1024];
12221 rng.fill_bytes(&mut buf);
12222 let mut unstructured = Unstructured::new(&buf);
12223 Self::arbitrary(&mut unstructured).unwrap_or_default()
12224 }
12225}
12226impl Default for GENERATOR_STATUS_DATA {
12227 fn default() -> Self {
12228 Self::DEFAULT.clone()
12229 }
12230}
12231impl MessageData for GENERATOR_STATUS_DATA {
12232 type Message = MavMessage;
12233 const ID: u32 = 373u32;
12234 const NAME: &'static str = "GENERATOR_STATUS";
12235 const EXTRA_CRC: u8 = 117u8;
12236 const ENCODED_LEN: usize = 42usize;
12237 fn deser(
12238 _version: MavlinkVersion,
12239 __input: &[u8],
12240 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12241 let avail_len = __input.len();
12242 let mut payload_buf = [0; Self::ENCODED_LEN];
12243 let mut buf = if avail_len < Self::ENCODED_LEN {
12244 payload_buf[0..avail_len].copy_from_slice(__input);
12245 Bytes::new(&payload_buf)
12246 } else {
12247 Bytes::new(__input)
12248 };
12249 let mut __struct = Self::default();
12250 let tmp = buf.get_u64_le();
12251 __struct.status =
12252 MavGeneratorStatusFlag::from_bits(tmp as <MavGeneratorStatusFlag as Flags>::Bits)
12253 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12254 flag_type: "MavGeneratorStatusFlag",
12255 value: tmp as u64,
12256 })?;
12257 __struct.battery_current = buf.get_f32_le();
12258 __struct.load_current = buf.get_f32_le();
12259 __struct.power_generated = buf.get_f32_le();
12260 __struct.bus_voltage = buf.get_f32_le();
12261 __struct.bat_current_setpoint = buf.get_f32_le();
12262 __struct.runtime = buf.get_u32_le();
12263 __struct.time_until_maintenance = buf.get_i32_le();
12264 __struct.generator_speed = buf.get_u16_le();
12265 __struct.rectifier_temperature = buf.get_i16_le();
12266 __struct.generator_temperature = buf.get_i16_le();
12267 Ok(__struct)
12268 }
12269 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12270 let mut __tmp = BytesMut::new(bytes);
12271 #[allow(clippy::absurd_extreme_comparisons)]
12272 #[allow(unused_comparisons)]
12273 if __tmp.remaining() < Self::ENCODED_LEN {
12274 panic!(
12275 "buffer is too small (need {} bytes, but got {})",
12276 Self::ENCODED_LEN,
12277 __tmp.remaining(),
12278 )
12279 }
12280 __tmp.put_u64_le(self.status.bits() as u64);
12281 __tmp.put_f32_le(self.battery_current);
12282 __tmp.put_f32_le(self.load_current);
12283 __tmp.put_f32_le(self.power_generated);
12284 __tmp.put_f32_le(self.bus_voltage);
12285 __tmp.put_f32_le(self.bat_current_setpoint);
12286 __tmp.put_u32_le(self.runtime);
12287 __tmp.put_i32_le(self.time_until_maintenance);
12288 __tmp.put_u16_le(self.generator_speed);
12289 __tmp.put_i16_le(self.rectifier_temperature);
12290 __tmp.put_i16_le(self.generator_temperature);
12291 if matches!(version, MavlinkVersion::V2) {
12292 let len = __tmp.len();
12293 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12294 } else {
12295 __tmp.len()
12296 }
12297 }
12298}
12299#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12300#[doc = ""]
12301#[doc = "ID: 285"]
12302#[derive(Debug, Clone, PartialEq)]
12303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12305#[cfg_attr(feature = "ts", derive(TS))]
12306#[cfg_attr(feature = "ts", ts(export))]
12307pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12308 #[doc = "Timestamp (time since system boot)."]
12309 pub time_boot_ms: u32,
12310 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12311 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12312 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12313 pub q: [f32; 4],
12314 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12315 pub angular_velocity_x: f32,
12316 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12317 pub angular_velocity_y: f32,
12318 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12319 pub angular_velocity_z: f32,
12320 #[doc = "Failure flags (0 for no failure)"]
12321 pub failure_flags: GimbalDeviceErrorFlags,
12322 #[doc = "Current gimbal flags set."]
12323 pub flags: GimbalDeviceFlags,
12324 #[doc = "System ID"]
12325 pub target_system: u8,
12326 #[doc = "Component ID"]
12327 pub target_component: u8,
12328 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12329 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12330 pub delta_yaw: f32,
12331 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12332 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12333 pub delta_yaw_velocity: f32,
12334 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12335 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12336 pub gimbal_device_id: u8,
12337}
12338impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12339 pub const ENCODED_LEN: usize = 49usize;
12340 pub const DEFAULT: Self = Self {
12341 time_boot_ms: 0_u32,
12342 q: [0.0_f32; 4usize],
12343 angular_velocity_x: 0.0_f32,
12344 angular_velocity_y: 0.0_f32,
12345 angular_velocity_z: 0.0_f32,
12346 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12347 flags: GimbalDeviceFlags::DEFAULT,
12348 target_system: 0_u8,
12349 target_component: 0_u8,
12350 delta_yaw: 0.0_f32,
12351 delta_yaw_velocity: 0.0_f32,
12352 gimbal_device_id: 0_u8,
12353 };
12354 #[cfg(feature = "arbitrary")]
12355 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12356 use arbitrary::{Arbitrary, Unstructured};
12357 let mut buf = [0u8; 1024];
12358 rng.fill_bytes(&mut buf);
12359 let mut unstructured = Unstructured::new(&buf);
12360 Self::arbitrary(&mut unstructured).unwrap_or_default()
12361 }
12362}
12363impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12364 fn default() -> Self {
12365 Self::DEFAULT.clone()
12366 }
12367}
12368impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12369 type Message = MavMessage;
12370 const ID: u32 = 285u32;
12371 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12372 const EXTRA_CRC: u8 = 137u8;
12373 const ENCODED_LEN: usize = 49usize;
12374 fn deser(
12375 _version: MavlinkVersion,
12376 __input: &[u8],
12377 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12378 let avail_len = __input.len();
12379 let mut payload_buf = [0; Self::ENCODED_LEN];
12380 let mut buf = if avail_len < Self::ENCODED_LEN {
12381 payload_buf[0..avail_len].copy_from_slice(__input);
12382 Bytes::new(&payload_buf)
12383 } else {
12384 Bytes::new(__input)
12385 };
12386 let mut __struct = Self::default();
12387 __struct.time_boot_ms = buf.get_u32_le();
12388 for v in &mut __struct.q {
12389 let val = buf.get_f32_le();
12390 *v = val;
12391 }
12392 __struct.angular_velocity_x = buf.get_f32_le();
12393 __struct.angular_velocity_y = buf.get_f32_le();
12394 __struct.angular_velocity_z = buf.get_f32_le();
12395 let tmp = buf.get_u32_le();
12396 __struct.failure_flags =
12397 GimbalDeviceErrorFlags::from_bits(tmp as <GimbalDeviceErrorFlags as Flags>::Bits)
12398 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12399 flag_type: "GimbalDeviceErrorFlags",
12400 value: tmp as u64,
12401 })?;
12402 let tmp = buf.get_u16_le();
12403 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
12404 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12405 flag_type: "GimbalDeviceFlags",
12406 value: tmp as u64,
12407 })?;
12408 __struct.target_system = buf.get_u8();
12409 __struct.target_component = buf.get_u8();
12410 __struct.delta_yaw = buf.get_f32_le();
12411 __struct.delta_yaw_velocity = buf.get_f32_le();
12412 __struct.gimbal_device_id = buf.get_u8();
12413 Ok(__struct)
12414 }
12415 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12416 let mut __tmp = BytesMut::new(bytes);
12417 #[allow(clippy::absurd_extreme_comparisons)]
12418 #[allow(unused_comparisons)]
12419 if __tmp.remaining() < Self::ENCODED_LEN {
12420 panic!(
12421 "buffer is too small (need {} bytes, but got {})",
12422 Self::ENCODED_LEN,
12423 __tmp.remaining(),
12424 )
12425 }
12426 __tmp.put_u32_le(self.time_boot_ms);
12427 for val in &self.q {
12428 __tmp.put_f32_le(*val);
12429 }
12430 __tmp.put_f32_le(self.angular_velocity_x);
12431 __tmp.put_f32_le(self.angular_velocity_y);
12432 __tmp.put_f32_le(self.angular_velocity_z);
12433 __tmp.put_u32_le(self.failure_flags.bits() as u32);
12434 __tmp.put_u16_le(self.flags.bits() as u16);
12435 __tmp.put_u8(self.target_system);
12436 __tmp.put_u8(self.target_component);
12437 if matches!(version, MavlinkVersion::V2) {
12438 __tmp.put_f32_le(self.delta_yaw);
12439 __tmp.put_f32_le(self.delta_yaw_velocity);
12440 __tmp.put_u8(self.gimbal_device_id);
12441 let len = __tmp.len();
12442 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12443 } else {
12444 __tmp.len()
12445 }
12446 }
12447}
12448#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12449#[doc = ""]
12450#[doc = "ID: 283"]
12451#[derive(Debug, Clone, PartialEq)]
12452#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12453#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12454#[cfg_attr(feature = "ts", derive(TS))]
12455#[cfg_attr(feature = "ts", ts(export))]
12456pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12457 #[doc = "UID of gimbal hardware (0 if unknown)."]
12458 pub uid: u64,
12459 #[doc = "Timestamp (time since system boot)."]
12460 pub time_boot_ms: u32,
12461 #[doc = "0xff)."]
12462 pub firmware_version: u32,
12463 #[doc = "0xff)."]
12464 pub hardware_version: u32,
12465 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12466 pub roll_min: f32,
12467 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12468 pub roll_max: f32,
12469 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12470 pub pitch_min: f32,
12471 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12472 pub pitch_max: f32,
12473 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12474 pub yaw_min: f32,
12475 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12476 pub yaw_max: f32,
12477 #[doc = "Bitmap of gimbal capability flags."]
12478 pub cap_flags: GimbalDeviceCapFlags,
12479 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12480 pub custom_cap_flags: u16,
12481 #[doc = "Name of the gimbal vendor."]
12482 #[cfg_attr(feature = "ts", ts(type = "string"))]
12483 pub vendor_name: CharArray<32>,
12484 #[doc = "Name of the gimbal model."]
12485 #[cfg_attr(feature = "ts", ts(type = "string"))]
12486 pub model_name: CharArray<32>,
12487 #[doc = "Custom name of the gimbal given to it by the user."]
12488 #[cfg_attr(feature = "ts", ts(type = "string"))]
12489 pub custom_name: CharArray<32>,
12490 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12491 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12492 pub gimbal_device_id: u8,
12493}
12494impl GIMBAL_DEVICE_INFORMATION_DATA {
12495 pub const ENCODED_LEN: usize = 145usize;
12496 pub const DEFAULT: Self = Self {
12497 uid: 0_u64,
12498 time_boot_ms: 0_u32,
12499 firmware_version: 0_u32,
12500 hardware_version: 0_u32,
12501 roll_min: 0.0_f32,
12502 roll_max: 0.0_f32,
12503 pitch_min: 0.0_f32,
12504 pitch_max: 0.0_f32,
12505 yaw_min: 0.0_f32,
12506 yaw_max: 0.0_f32,
12507 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12508 custom_cap_flags: 0_u16,
12509 vendor_name: CharArray::new([0_u8; 32usize]),
12510 model_name: CharArray::new([0_u8; 32usize]),
12511 custom_name: CharArray::new([0_u8; 32usize]),
12512 gimbal_device_id: 0_u8,
12513 };
12514 #[cfg(feature = "arbitrary")]
12515 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12516 use arbitrary::{Arbitrary, Unstructured};
12517 let mut buf = [0u8; 1024];
12518 rng.fill_bytes(&mut buf);
12519 let mut unstructured = Unstructured::new(&buf);
12520 Self::arbitrary(&mut unstructured).unwrap_or_default()
12521 }
12522}
12523impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12524 fn default() -> Self {
12525 Self::DEFAULT.clone()
12526 }
12527}
12528impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12529 type Message = MavMessage;
12530 const ID: u32 = 283u32;
12531 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12532 const EXTRA_CRC: u8 = 74u8;
12533 const ENCODED_LEN: usize = 145usize;
12534 fn deser(
12535 _version: MavlinkVersion,
12536 __input: &[u8],
12537 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12538 let avail_len = __input.len();
12539 let mut payload_buf = [0; Self::ENCODED_LEN];
12540 let mut buf = if avail_len < Self::ENCODED_LEN {
12541 payload_buf[0..avail_len].copy_from_slice(__input);
12542 Bytes::new(&payload_buf)
12543 } else {
12544 Bytes::new(__input)
12545 };
12546 let mut __struct = Self::default();
12547 __struct.uid = buf.get_u64_le();
12548 __struct.time_boot_ms = buf.get_u32_le();
12549 __struct.firmware_version = buf.get_u32_le();
12550 __struct.hardware_version = buf.get_u32_le();
12551 __struct.roll_min = buf.get_f32_le();
12552 __struct.roll_max = buf.get_f32_le();
12553 __struct.pitch_min = buf.get_f32_le();
12554 __struct.pitch_max = buf.get_f32_le();
12555 __struct.yaw_min = buf.get_f32_le();
12556 __struct.yaw_max = buf.get_f32_le();
12557 let tmp = buf.get_u16_le();
12558 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12559 tmp as <GimbalDeviceCapFlags as Flags>::Bits,
12560 )
12561 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12562 flag_type: "GimbalDeviceCapFlags",
12563 value: tmp as u64,
12564 })?;
12565 __struct.custom_cap_flags = buf.get_u16_le();
12566 let mut tmp = [0_u8; 32usize];
12567 for v in &mut tmp {
12568 *v = buf.get_u8();
12569 }
12570 __struct.vendor_name = CharArray::new(tmp);
12571 let mut tmp = [0_u8; 32usize];
12572 for v in &mut tmp {
12573 *v = buf.get_u8();
12574 }
12575 __struct.model_name = CharArray::new(tmp);
12576 let mut tmp = [0_u8; 32usize];
12577 for v in &mut tmp {
12578 *v = buf.get_u8();
12579 }
12580 __struct.custom_name = CharArray::new(tmp);
12581 __struct.gimbal_device_id = buf.get_u8();
12582 Ok(__struct)
12583 }
12584 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12585 let mut __tmp = BytesMut::new(bytes);
12586 #[allow(clippy::absurd_extreme_comparisons)]
12587 #[allow(unused_comparisons)]
12588 if __tmp.remaining() < Self::ENCODED_LEN {
12589 panic!(
12590 "buffer is too small (need {} bytes, but got {})",
12591 Self::ENCODED_LEN,
12592 __tmp.remaining(),
12593 )
12594 }
12595 __tmp.put_u64_le(self.uid);
12596 __tmp.put_u32_le(self.time_boot_ms);
12597 __tmp.put_u32_le(self.firmware_version);
12598 __tmp.put_u32_le(self.hardware_version);
12599 __tmp.put_f32_le(self.roll_min);
12600 __tmp.put_f32_le(self.roll_max);
12601 __tmp.put_f32_le(self.pitch_min);
12602 __tmp.put_f32_le(self.pitch_max);
12603 __tmp.put_f32_le(self.yaw_min);
12604 __tmp.put_f32_le(self.yaw_max);
12605 __tmp.put_u16_le(self.cap_flags.bits() as u16);
12606 __tmp.put_u16_le(self.custom_cap_flags);
12607 for val in &self.vendor_name {
12608 __tmp.put_u8(*val);
12609 }
12610 for val in &self.model_name {
12611 __tmp.put_u8(*val);
12612 }
12613 for val in &self.custom_name {
12614 __tmp.put_u8(*val);
12615 }
12616 if matches!(version, MavlinkVersion::V2) {
12617 __tmp.put_u8(self.gimbal_device_id);
12618 let len = __tmp.len();
12619 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12620 } else {
12621 __tmp.len()
12622 }
12623 }
12624}
12625#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12626#[doc = ""]
12627#[doc = "ID: 284"]
12628#[derive(Debug, Clone, PartialEq)]
12629#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12630#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12631#[cfg_attr(feature = "ts", derive(TS))]
12632#[cfg_attr(feature = "ts", ts(export))]
12633pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12634 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12635 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12636 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12637 pub q: [f32; 4],
12638 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12639 pub angular_velocity_x: f32,
12640 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12641 pub angular_velocity_y: f32,
12642 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12643 pub angular_velocity_z: f32,
12644 #[doc = "Low level gimbal flags."]
12645 pub flags: GimbalDeviceFlags,
12646 #[doc = "System ID"]
12647 pub target_system: u8,
12648 #[doc = "Component ID"]
12649 pub target_component: u8,
12650}
12651impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12652 pub const ENCODED_LEN: usize = 32usize;
12653 pub const DEFAULT: Self = Self {
12654 q: [0.0_f32; 4usize],
12655 angular_velocity_x: 0.0_f32,
12656 angular_velocity_y: 0.0_f32,
12657 angular_velocity_z: 0.0_f32,
12658 flags: GimbalDeviceFlags::DEFAULT,
12659 target_system: 0_u8,
12660 target_component: 0_u8,
12661 };
12662 #[cfg(feature = "arbitrary")]
12663 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12664 use arbitrary::{Arbitrary, Unstructured};
12665 let mut buf = [0u8; 1024];
12666 rng.fill_bytes(&mut buf);
12667 let mut unstructured = Unstructured::new(&buf);
12668 Self::arbitrary(&mut unstructured).unwrap_or_default()
12669 }
12670}
12671impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12672 fn default() -> Self {
12673 Self::DEFAULT.clone()
12674 }
12675}
12676impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12677 type Message = MavMessage;
12678 const ID: u32 = 284u32;
12679 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12680 const EXTRA_CRC: u8 = 99u8;
12681 const ENCODED_LEN: usize = 32usize;
12682 fn deser(
12683 _version: MavlinkVersion,
12684 __input: &[u8],
12685 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12686 let avail_len = __input.len();
12687 let mut payload_buf = [0; Self::ENCODED_LEN];
12688 let mut buf = if avail_len < Self::ENCODED_LEN {
12689 payload_buf[0..avail_len].copy_from_slice(__input);
12690 Bytes::new(&payload_buf)
12691 } else {
12692 Bytes::new(__input)
12693 };
12694 let mut __struct = Self::default();
12695 for v in &mut __struct.q {
12696 let val = buf.get_f32_le();
12697 *v = val;
12698 }
12699 __struct.angular_velocity_x = buf.get_f32_le();
12700 __struct.angular_velocity_y = buf.get_f32_le();
12701 __struct.angular_velocity_z = buf.get_f32_le();
12702 let tmp = buf.get_u16_le();
12703 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
12704 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12705 flag_type: "GimbalDeviceFlags",
12706 value: tmp as u64,
12707 })?;
12708 __struct.target_system = buf.get_u8();
12709 __struct.target_component = buf.get_u8();
12710 Ok(__struct)
12711 }
12712 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12713 let mut __tmp = BytesMut::new(bytes);
12714 #[allow(clippy::absurd_extreme_comparisons)]
12715 #[allow(unused_comparisons)]
12716 if __tmp.remaining() < Self::ENCODED_LEN {
12717 panic!(
12718 "buffer is too small (need {} bytes, but got {})",
12719 Self::ENCODED_LEN,
12720 __tmp.remaining(),
12721 )
12722 }
12723 for val in &self.q {
12724 __tmp.put_f32_le(*val);
12725 }
12726 __tmp.put_f32_le(self.angular_velocity_x);
12727 __tmp.put_f32_le(self.angular_velocity_y);
12728 __tmp.put_f32_le(self.angular_velocity_z);
12729 __tmp.put_u16_le(self.flags.bits() as u16);
12730 __tmp.put_u8(self.target_system);
12731 __tmp.put_u8(self.target_component);
12732 if matches!(version, MavlinkVersion::V2) {
12733 let len = __tmp.len();
12734 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12735 } else {
12736 __tmp.len()
12737 }
12738 }
12739}
12740#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12741#[doc = ""]
12742#[doc = "ID: 280"]
12743#[derive(Debug, Clone, PartialEq)]
12744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12745#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12746#[cfg_attr(feature = "ts", derive(TS))]
12747#[cfg_attr(feature = "ts", ts(export))]
12748pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12749 #[doc = "Timestamp (time since system boot)."]
12750 pub time_boot_ms: u32,
12751 #[doc = "Bitmap of gimbal capability flags."]
12752 pub cap_flags: GimbalManagerCapFlags,
12753 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12754 pub roll_min: f32,
12755 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12756 pub roll_max: f32,
12757 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12758 pub pitch_min: f32,
12759 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12760 pub pitch_max: f32,
12761 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12762 pub yaw_min: f32,
12763 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12764 pub yaw_max: f32,
12765 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12766 pub gimbal_device_id: u8,
12767}
12768impl GIMBAL_MANAGER_INFORMATION_DATA {
12769 pub const ENCODED_LEN: usize = 33usize;
12770 pub const DEFAULT: Self = Self {
12771 time_boot_ms: 0_u32,
12772 cap_flags: GimbalManagerCapFlags::DEFAULT,
12773 roll_min: 0.0_f32,
12774 roll_max: 0.0_f32,
12775 pitch_min: 0.0_f32,
12776 pitch_max: 0.0_f32,
12777 yaw_min: 0.0_f32,
12778 yaw_max: 0.0_f32,
12779 gimbal_device_id: 0_u8,
12780 };
12781 #[cfg(feature = "arbitrary")]
12782 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12783 use arbitrary::{Arbitrary, Unstructured};
12784 let mut buf = [0u8; 1024];
12785 rng.fill_bytes(&mut buf);
12786 let mut unstructured = Unstructured::new(&buf);
12787 Self::arbitrary(&mut unstructured).unwrap_or_default()
12788 }
12789}
12790impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12791 fn default() -> Self {
12792 Self::DEFAULT.clone()
12793 }
12794}
12795impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12796 type Message = MavMessage;
12797 const ID: u32 = 280u32;
12798 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12799 const EXTRA_CRC: u8 = 70u8;
12800 const ENCODED_LEN: usize = 33usize;
12801 fn deser(
12802 _version: MavlinkVersion,
12803 __input: &[u8],
12804 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12805 let avail_len = __input.len();
12806 let mut payload_buf = [0; Self::ENCODED_LEN];
12807 let mut buf = if avail_len < Self::ENCODED_LEN {
12808 payload_buf[0..avail_len].copy_from_slice(__input);
12809 Bytes::new(&payload_buf)
12810 } else {
12811 Bytes::new(__input)
12812 };
12813 let mut __struct = Self::default();
12814 __struct.time_boot_ms = buf.get_u32_le();
12815 let tmp = buf.get_u32_le();
12816 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12817 tmp as <GimbalManagerCapFlags as Flags>::Bits,
12818 )
12819 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12820 flag_type: "GimbalManagerCapFlags",
12821 value: tmp as u64,
12822 })?;
12823 __struct.roll_min = buf.get_f32_le();
12824 __struct.roll_max = buf.get_f32_le();
12825 __struct.pitch_min = buf.get_f32_le();
12826 __struct.pitch_max = buf.get_f32_le();
12827 __struct.yaw_min = buf.get_f32_le();
12828 __struct.yaw_max = buf.get_f32_le();
12829 __struct.gimbal_device_id = buf.get_u8();
12830 Ok(__struct)
12831 }
12832 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12833 let mut __tmp = BytesMut::new(bytes);
12834 #[allow(clippy::absurd_extreme_comparisons)]
12835 #[allow(unused_comparisons)]
12836 if __tmp.remaining() < Self::ENCODED_LEN {
12837 panic!(
12838 "buffer is too small (need {} bytes, but got {})",
12839 Self::ENCODED_LEN,
12840 __tmp.remaining(),
12841 )
12842 }
12843 __tmp.put_u32_le(self.time_boot_ms);
12844 __tmp.put_u32_le(self.cap_flags.bits() as u32);
12845 __tmp.put_f32_le(self.roll_min);
12846 __tmp.put_f32_le(self.roll_max);
12847 __tmp.put_f32_le(self.pitch_min);
12848 __tmp.put_f32_le(self.pitch_max);
12849 __tmp.put_f32_le(self.yaw_min);
12850 __tmp.put_f32_le(self.yaw_max);
12851 __tmp.put_u8(self.gimbal_device_id);
12852 if matches!(version, MavlinkVersion::V2) {
12853 let len = __tmp.len();
12854 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12855 } else {
12856 __tmp.len()
12857 }
12858 }
12859}
12860#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12861#[doc = ""]
12862#[doc = "ID: 282"]
12863#[derive(Debug, Clone, PartialEq)]
12864#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12865#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12866#[cfg_attr(feature = "ts", derive(TS))]
12867#[cfg_attr(feature = "ts", ts(export))]
12868pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12869 #[doc = "High level gimbal manager flags to use."]
12870 pub flags: GimbalManagerFlags,
12871 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
12872 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12873 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12874 pub q: [f32; 4],
12875 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
12876 pub angular_velocity_x: f32,
12877 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
12878 pub angular_velocity_y: f32,
12879 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
12880 pub angular_velocity_z: f32,
12881 #[doc = "System ID"]
12882 pub target_system: u8,
12883 #[doc = "Component ID"]
12884 pub target_component: u8,
12885 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12886 pub gimbal_device_id: u8,
12887}
12888impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12889 pub const ENCODED_LEN: usize = 35usize;
12890 pub const DEFAULT: Self = Self {
12891 flags: GimbalManagerFlags::DEFAULT,
12892 q: [0.0_f32; 4usize],
12893 angular_velocity_x: 0.0_f32,
12894 angular_velocity_y: 0.0_f32,
12895 angular_velocity_z: 0.0_f32,
12896 target_system: 0_u8,
12897 target_component: 0_u8,
12898 gimbal_device_id: 0_u8,
12899 };
12900 #[cfg(feature = "arbitrary")]
12901 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12902 use arbitrary::{Arbitrary, Unstructured};
12903 let mut buf = [0u8; 1024];
12904 rng.fill_bytes(&mut buf);
12905 let mut unstructured = Unstructured::new(&buf);
12906 Self::arbitrary(&mut unstructured).unwrap_or_default()
12907 }
12908}
12909impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12910 fn default() -> Self {
12911 Self::DEFAULT.clone()
12912 }
12913}
12914impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12915 type Message = MavMessage;
12916 const ID: u32 = 282u32;
12917 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
12918 const EXTRA_CRC: u8 = 123u8;
12919 const ENCODED_LEN: usize = 35usize;
12920 fn deser(
12921 _version: MavlinkVersion,
12922 __input: &[u8],
12923 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12924 let avail_len = __input.len();
12925 let mut payload_buf = [0; Self::ENCODED_LEN];
12926 let mut buf = if avail_len < Self::ENCODED_LEN {
12927 payload_buf[0..avail_len].copy_from_slice(__input);
12928 Bytes::new(&payload_buf)
12929 } else {
12930 Bytes::new(__input)
12931 };
12932 let mut __struct = Self::default();
12933 let tmp = buf.get_u32_le();
12934 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
12935 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12936 flag_type: "GimbalManagerFlags",
12937 value: tmp as u64,
12938 })?;
12939 for v in &mut __struct.q {
12940 let val = buf.get_f32_le();
12941 *v = val;
12942 }
12943 __struct.angular_velocity_x = buf.get_f32_le();
12944 __struct.angular_velocity_y = buf.get_f32_le();
12945 __struct.angular_velocity_z = buf.get_f32_le();
12946 __struct.target_system = buf.get_u8();
12947 __struct.target_component = buf.get_u8();
12948 __struct.gimbal_device_id = buf.get_u8();
12949 Ok(__struct)
12950 }
12951 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12952 let mut __tmp = BytesMut::new(bytes);
12953 #[allow(clippy::absurd_extreme_comparisons)]
12954 #[allow(unused_comparisons)]
12955 if __tmp.remaining() < Self::ENCODED_LEN {
12956 panic!(
12957 "buffer is too small (need {} bytes, but got {})",
12958 Self::ENCODED_LEN,
12959 __tmp.remaining(),
12960 )
12961 }
12962 __tmp.put_u32_le(self.flags.bits() as u32);
12963 for val in &self.q {
12964 __tmp.put_f32_le(*val);
12965 }
12966 __tmp.put_f32_le(self.angular_velocity_x);
12967 __tmp.put_f32_le(self.angular_velocity_y);
12968 __tmp.put_f32_le(self.angular_velocity_z);
12969 __tmp.put_u8(self.target_system);
12970 __tmp.put_u8(self.target_component);
12971 __tmp.put_u8(self.gimbal_device_id);
12972 if matches!(version, MavlinkVersion::V2) {
12973 let len = __tmp.len();
12974 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12975 } else {
12976 __tmp.len()
12977 }
12978 }
12979}
12980#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12981#[doc = ""]
12982#[doc = "ID: 288"]
12983#[derive(Debug, Clone, PartialEq)]
12984#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12985#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12986#[cfg_attr(feature = "ts", derive(TS))]
12987#[cfg_attr(feature = "ts", ts(export))]
12988pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12989 #[doc = "High level gimbal manager flags."]
12990 pub flags: GimbalManagerFlags,
12991 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12992 pub pitch: f32,
12993 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12994 pub yaw: f32,
12995 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12996 pub pitch_rate: f32,
12997 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12998 pub yaw_rate: f32,
12999 #[doc = "System ID"]
13000 pub target_system: u8,
13001 #[doc = "Component ID"]
13002 pub target_component: u8,
13003 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13004 pub gimbal_device_id: u8,
13005}
13006impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13007 pub const ENCODED_LEN: usize = 23usize;
13008 pub const DEFAULT: Self = Self {
13009 flags: GimbalManagerFlags::DEFAULT,
13010 pitch: 0.0_f32,
13011 yaw: 0.0_f32,
13012 pitch_rate: 0.0_f32,
13013 yaw_rate: 0.0_f32,
13014 target_system: 0_u8,
13015 target_component: 0_u8,
13016 gimbal_device_id: 0_u8,
13017 };
13018 #[cfg(feature = "arbitrary")]
13019 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13020 use arbitrary::{Arbitrary, Unstructured};
13021 let mut buf = [0u8; 1024];
13022 rng.fill_bytes(&mut buf);
13023 let mut unstructured = Unstructured::new(&buf);
13024 Self::arbitrary(&mut unstructured).unwrap_or_default()
13025 }
13026}
13027impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13028 fn default() -> Self {
13029 Self::DEFAULT.clone()
13030 }
13031}
13032impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13033 type Message = MavMessage;
13034 const ID: u32 = 288u32;
13035 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13036 const EXTRA_CRC: u8 = 20u8;
13037 const ENCODED_LEN: usize = 23usize;
13038 fn deser(
13039 _version: MavlinkVersion,
13040 __input: &[u8],
13041 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13042 let avail_len = __input.len();
13043 let mut payload_buf = [0; Self::ENCODED_LEN];
13044 let mut buf = if avail_len < Self::ENCODED_LEN {
13045 payload_buf[0..avail_len].copy_from_slice(__input);
13046 Bytes::new(&payload_buf)
13047 } else {
13048 Bytes::new(__input)
13049 };
13050 let mut __struct = Self::default();
13051 let tmp = buf.get_u32_le();
13052 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13053 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13054 flag_type: "GimbalManagerFlags",
13055 value: tmp as u64,
13056 })?;
13057 __struct.pitch = buf.get_f32_le();
13058 __struct.yaw = buf.get_f32_le();
13059 __struct.pitch_rate = buf.get_f32_le();
13060 __struct.yaw_rate = buf.get_f32_le();
13061 __struct.target_system = buf.get_u8();
13062 __struct.target_component = buf.get_u8();
13063 __struct.gimbal_device_id = buf.get_u8();
13064 Ok(__struct)
13065 }
13066 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13067 let mut __tmp = BytesMut::new(bytes);
13068 #[allow(clippy::absurd_extreme_comparisons)]
13069 #[allow(unused_comparisons)]
13070 if __tmp.remaining() < Self::ENCODED_LEN {
13071 panic!(
13072 "buffer is too small (need {} bytes, but got {})",
13073 Self::ENCODED_LEN,
13074 __tmp.remaining(),
13075 )
13076 }
13077 __tmp.put_u32_le(self.flags.bits() as u32);
13078 __tmp.put_f32_le(self.pitch);
13079 __tmp.put_f32_le(self.yaw);
13080 __tmp.put_f32_le(self.pitch_rate);
13081 __tmp.put_f32_le(self.yaw_rate);
13082 __tmp.put_u8(self.target_system);
13083 __tmp.put_u8(self.target_component);
13084 __tmp.put_u8(self.gimbal_device_id);
13085 if matches!(version, MavlinkVersion::V2) {
13086 let len = __tmp.len();
13087 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13088 } else {
13089 __tmp.len()
13090 }
13091 }
13092}
13093#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13094#[doc = ""]
13095#[doc = "ID: 287"]
13096#[derive(Debug, Clone, PartialEq)]
13097#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13098#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13099#[cfg_attr(feature = "ts", derive(TS))]
13100#[cfg_attr(feature = "ts", ts(export))]
13101pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13102 #[doc = "High level gimbal manager flags to use."]
13103 pub flags: GimbalManagerFlags,
13104 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13105 pub pitch: f32,
13106 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13107 pub yaw: f32,
13108 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13109 pub pitch_rate: f32,
13110 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13111 pub yaw_rate: f32,
13112 #[doc = "System ID"]
13113 pub target_system: u8,
13114 #[doc = "Component ID"]
13115 pub target_component: u8,
13116 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13117 pub gimbal_device_id: u8,
13118}
13119impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13120 pub const ENCODED_LEN: usize = 23usize;
13121 pub const DEFAULT: Self = Self {
13122 flags: GimbalManagerFlags::DEFAULT,
13123 pitch: 0.0_f32,
13124 yaw: 0.0_f32,
13125 pitch_rate: 0.0_f32,
13126 yaw_rate: 0.0_f32,
13127 target_system: 0_u8,
13128 target_component: 0_u8,
13129 gimbal_device_id: 0_u8,
13130 };
13131 #[cfg(feature = "arbitrary")]
13132 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13133 use arbitrary::{Arbitrary, Unstructured};
13134 let mut buf = [0u8; 1024];
13135 rng.fill_bytes(&mut buf);
13136 let mut unstructured = Unstructured::new(&buf);
13137 Self::arbitrary(&mut unstructured).unwrap_or_default()
13138 }
13139}
13140impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13141 fn default() -> Self {
13142 Self::DEFAULT.clone()
13143 }
13144}
13145impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13146 type Message = MavMessage;
13147 const ID: u32 = 287u32;
13148 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13149 const EXTRA_CRC: u8 = 1u8;
13150 const ENCODED_LEN: usize = 23usize;
13151 fn deser(
13152 _version: MavlinkVersion,
13153 __input: &[u8],
13154 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13155 let avail_len = __input.len();
13156 let mut payload_buf = [0; Self::ENCODED_LEN];
13157 let mut buf = if avail_len < Self::ENCODED_LEN {
13158 payload_buf[0..avail_len].copy_from_slice(__input);
13159 Bytes::new(&payload_buf)
13160 } else {
13161 Bytes::new(__input)
13162 };
13163 let mut __struct = Self::default();
13164 let tmp = buf.get_u32_le();
13165 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13166 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13167 flag_type: "GimbalManagerFlags",
13168 value: tmp as u64,
13169 })?;
13170 __struct.pitch = buf.get_f32_le();
13171 __struct.yaw = buf.get_f32_le();
13172 __struct.pitch_rate = buf.get_f32_le();
13173 __struct.yaw_rate = buf.get_f32_le();
13174 __struct.target_system = buf.get_u8();
13175 __struct.target_component = buf.get_u8();
13176 __struct.gimbal_device_id = buf.get_u8();
13177 Ok(__struct)
13178 }
13179 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13180 let mut __tmp = BytesMut::new(bytes);
13181 #[allow(clippy::absurd_extreme_comparisons)]
13182 #[allow(unused_comparisons)]
13183 if __tmp.remaining() < Self::ENCODED_LEN {
13184 panic!(
13185 "buffer is too small (need {} bytes, but got {})",
13186 Self::ENCODED_LEN,
13187 __tmp.remaining(),
13188 )
13189 }
13190 __tmp.put_u32_le(self.flags.bits() as u32);
13191 __tmp.put_f32_le(self.pitch);
13192 __tmp.put_f32_le(self.yaw);
13193 __tmp.put_f32_le(self.pitch_rate);
13194 __tmp.put_f32_le(self.yaw_rate);
13195 __tmp.put_u8(self.target_system);
13196 __tmp.put_u8(self.target_component);
13197 __tmp.put_u8(self.gimbal_device_id);
13198 if matches!(version, MavlinkVersion::V2) {
13199 let len = __tmp.len();
13200 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13201 } else {
13202 __tmp.len()
13203 }
13204 }
13205}
13206#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13207#[doc = ""]
13208#[doc = "ID: 281"]
13209#[derive(Debug, Clone, PartialEq)]
13210#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13211#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13212#[cfg_attr(feature = "ts", derive(TS))]
13213#[cfg_attr(feature = "ts", ts(export))]
13214pub struct GIMBAL_MANAGER_STATUS_DATA {
13215 #[doc = "Timestamp (time since system boot)."]
13216 pub time_boot_ms: u32,
13217 #[doc = "High level gimbal manager flags currently applied."]
13218 pub flags: GimbalManagerFlags,
13219 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13220 pub gimbal_device_id: u8,
13221 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13222 pub primary_control_sysid: u8,
13223 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13224 pub primary_control_compid: u8,
13225 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13226 pub secondary_control_sysid: u8,
13227 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13228 pub secondary_control_compid: u8,
13229}
13230impl GIMBAL_MANAGER_STATUS_DATA {
13231 pub const ENCODED_LEN: usize = 13usize;
13232 pub const DEFAULT: Self = Self {
13233 time_boot_ms: 0_u32,
13234 flags: GimbalManagerFlags::DEFAULT,
13235 gimbal_device_id: 0_u8,
13236 primary_control_sysid: 0_u8,
13237 primary_control_compid: 0_u8,
13238 secondary_control_sysid: 0_u8,
13239 secondary_control_compid: 0_u8,
13240 };
13241 #[cfg(feature = "arbitrary")]
13242 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13243 use arbitrary::{Arbitrary, Unstructured};
13244 let mut buf = [0u8; 1024];
13245 rng.fill_bytes(&mut buf);
13246 let mut unstructured = Unstructured::new(&buf);
13247 Self::arbitrary(&mut unstructured).unwrap_or_default()
13248 }
13249}
13250impl Default for GIMBAL_MANAGER_STATUS_DATA {
13251 fn default() -> Self {
13252 Self::DEFAULT.clone()
13253 }
13254}
13255impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13256 type Message = MavMessage;
13257 const ID: u32 = 281u32;
13258 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13259 const EXTRA_CRC: u8 = 48u8;
13260 const ENCODED_LEN: usize = 13usize;
13261 fn deser(
13262 _version: MavlinkVersion,
13263 __input: &[u8],
13264 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13265 let avail_len = __input.len();
13266 let mut payload_buf = [0; Self::ENCODED_LEN];
13267 let mut buf = if avail_len < Self::ENCODED_LEN {
13268 payload_buf[0..avail_len].copy_from_slice(__input);
13269 Bytes::new(&payload_buf)
13270 } else {
13271 Bytes::new(__input)
13272 };
13273 let mut __struct = Self::default();
13274 __struct.time_boot_ms = buf.get_u32_le();
13275 let tmp = buf.get_u32_le();
13276 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13277 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13278 flag_type: "GimbalManagerFlags",
13279 value: tmp as u64,
13280 })?;
13281 __struct.gimbal_device_id = buf.get_u8();
13282 __struct.primary_control_sysid = buf.get_u8();
13283 __struct.primary_control_compid = buf.get_u8();
13284 __struct.secondary_control_sysid = buf.get_u8();
13285 __struct.secondary_control_compid = buf.get_u8();
13286 Ok(__struct)
13287 }
13288 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13289 let mut __tmp = BytesMut::new(bytes);
13290 #[allow(clippy::absurd_extreme_comparisons)]
13291 #[allow(unused_comparisons)]
13292 if __tmp.remaining() < Self::ENCODED_LEN {
13293 panic!(
13294 "buffer is too small (need {} bytes, but got {})",
13295 Self::ENCODED_LEN,
13296 __tmp.remaining(),
13297 )
13298 }
13299 __tmp.put_u32_le(self.time_boot_ms);
13300 __tmp.put_u32_le(self.flags.bits() as u32);
13301 __tmp.put_u8(self.gimbal_device_id);
13302 __tmp.put_u8(self.primary_control_sysid);
13303 __tmp.put_u8(self.primary_control_compid);
13304 __tmp.put_u8(self.secondary_control_sysid);
13305 __tmp.put_u8(self.secondary_control_compid);
13306 if matches!(version, MavlinkVersion::V2) {
13307 let len = __tmp.len();
13308 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13309 } else {
13310 __tmp.len()
13311 }
13312 }
13313}
13314#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13315#[doc = ""]
13316#[doc = "ID: 33"]
13317#[derive(Debug, Clone, PartialEq)]
13318#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13319#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13320#[cfg_attr(feature = "ts", derive(TS))]
13321#[cfg_attr(feature = "ts", ts(export))]
13322pub struct GLOBAL_POSITION_INT_DATA {
13323 #[doc = "Timestamp (time since system boot)."]
13324 pub time_boot_ms: u32,
13325 #[doc = "Latitude, expressed"]
13326 pub lat: i32,
13327 #[doc = "Longitude, expressed"]
13328 pub lon: i32,
13329 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13330 pub alt: i32,
13331 #[doc = "Altitude above home"]
13332 pub relative_alt: i32,
13333 #[doc = "Ground X Speed (Latitude, positive north)"]
13334 pub vx: i16,
13335 #[doc = "Ground Y Speed (Longitude, positive east)"]
13336 pub vy: i16,
13337 #[doc = "Ground Z Speed (Altitude, positive down)"]
13338 pub vz: i16,
13339 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13340 pub hdg: u16,
13341}
13342impl GLOBAL_POSITION_INT_DATA {
13343 pub const ENCODED_LEN: usize = 28usize;
13344 pub const DEFAULT: Self = Self {
13345 time_boot_ms: 0_u32,
13346 lat: 0_i32,
13347 lon: 0_i32,
13348 alt: 0_i32,
13349 relative_alt: 0_i32,
13350 vx: 0_i16,
13351 vy: 0_i16,
13352 vz: 0_i16,
13353 hdg: 0_u16,
13354 };
13355 #[cfg(feature = "arbitrary")]
13356 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13357 use arbitrary::{Arbitrary, Unstructured};
13358 let mut buf = [0u8; 1024];
13359 rng.fill_bytes(&mut buf);
13360 let mut unstructured = Unstructured::new(&buf);
13361 Self::arbitrary(&mut unstructured).unwrap_or_default()
13362 }
13363}
13364impl Default for GLOBAL_POSITION_INT_DATA {
13365 fn default() -> Self {
13366 Self::DEFAULT.clone()
13367 }
13368}
13369impl MessageData for GLOBAL_POSITION_INT_DATA {
13370 type Message = MavMessage;
13371 const ID: u32 = 33u32;
13372 const NAME: &'static str = "GLOBAL_POSITION_INT";
13373 const EXTRA_CRC: u8 = 104u8;
13374 const ENCODED_LEN: usize = 28usize;
13375 fn deser(
13376 _version: MavlinkVersion,
13377 __input: &[u8],
13378 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13379 let avail_len = __input.len();
13380 let mut payload_buf = [0; Self::ENCODED_LEN];
13381 let mut buf = if avail_len < Self::ENCODED_LEN {
13382 payload_buf[0..avail_len].copy_from_slice(__input);
13383 Bytes::new(&payload_buf)
13384 } else {
13385 Bytes::new(__input)
13386 };
13387 let mut __struct = Self::default();
13388 __struct.time_boot_ms = buf.get_u32_le();
13389 __struct.lat = buf.get_i32_le();
13390 __struct.lon = buf.get_i32_le();
13391 __struct.alt = buf.get_i32_le();
13392 __struct.relative_alt = buf.get_i32_le();
13393 __struct.vx = buf.get_i16_le();
13394 __struct.vy = buf.get_i16_le();
13395 __struct.vz = buf.get_i16_le();
13396 __struct.hdg = buf.get_u16_le();
13397 Ok(__struct)
13398 }
13399 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13400 let mut __tmp = BytesMut::new(bytes);
13401 #[allow(clippy::absurd_extreme_comparisons)]
13402 #[allow(unused_comparisons)]
13403 if __tmp.remaining() < Self::ENCODED_LEN {
13404 panic!(
13405 "buffer is too small (need {} bytes, but got {})",
13406 Self::ENCODED_LEN,
13407 __tmp.remaining(),
13408 )
13409 }
13410 __tmp.put_u32_le(self.time_boot_ms);
13411 __tmp.put_i32_le(self.lat);
13412 __tmp.put_i32_le(self.lon);
13413 __tmp.put_i32_le(self.alt);
13414 __tmp.put_i32_le(self.relative_alt);
13415 __tmp.put_i16_le(self.vx);
13416 __tmp.put_i16_le(self.vy);
13417 __tmp.put_i16_le(self.vz);
13418 __tmp.put_u16_le(self.hdg);
13419 if matches!(version, MavlinkVersion::V2) {
13420 let len = __tmp.len();
13421 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13422 } else {
13423 __tmp.len()
13424 }
13425 }
13426}
13427#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13428#[doc = ""]
13429#[doc = "ID: 63"]
13430#[derive(Debug, Clone, PartialEq)]
13431#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13432#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13433#[cfg_attr(feature = "ts", derive(TS))]
13434#[cfg_attr(feature = "ts", ts(export))]
13435pub struct GLOBAL_POSITION_INT_COV_DATA {
13436 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13437 pub time_usec: u64,
13438 #[doc = "Latitude"]
13439 pub lat: i32,
13440 #[doc = "Longitude"]
13441 pub lon: i32,
13442 #[doc = "Altitude in meters above MSL"]
13443 pub alt: i32,
13444 #[doc = "Altitude above ground"]
13445 pub relative_alt: i32,
13446 #[doc = "Ground X Speed (Latitude)"]
13447 pub vx: f32,
13448 #[doc = "Ground Y Speed (Longitude)"]
13449 pub vy: f32,
13450 #[doc = "Ground Z Speed (Altitude)"]
13451 pub vz: f32,
13452 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13453 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13454 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13455 pub covariance: [f32; 36],
13456 #[doc = "Class id of the estimator this estimate originated from."]
13457 pub estimator_type: MavEstimatorType,
13458}
13459impl GLOBAL_POSITION_INT_COV_DATA {
13460 pub const ENCODED_LEN: usize = 181usize;
13461 pub const DEFAULT: Self = Self {
13462 time_usec: 0_u64,
13463 lat: 0_i32,
13464 lon: 0_i32,
13465 alt: 0_i32,
13466 relative_alt: 0_i32,
13467 vx: 0.0_f32,
13468 vy: 0.0_f32,
13469 vz: 0.0_f32,
13470 covariance: [0.0_f32; 36usize],
13471 estimator_type: MavEstimatorType::DEFAULT,
13472 };
13473 #[cfg(feature = "arbitrary")]
13474 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13475 use arbitrary::{Arbitrary, Unstructured};
13476 let mut buf = [0u8; 1024];
13477 rng.fill_bytes(&mut buf);
13478 let mut unstructured = Unstructured::new(&buf);
13479 Self::arbitrary(&mut unstructured).unwrap_or_default()
13480 }
13481}
13482impl Default for GLOBAL_POSITION_INT_COV_DATA {
13483 fn default() -> Self {
13484 Self::DEFAULT.clone()
13485 }
13486}
13487impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13488 type Message = MavMessage;
13489 const ID: u32 = 63u32;
13490 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13491 const EXTRA_CRC: u8 = 119u8;
13492 const ENCODED_LEN: usize = 181usize;
13493 fn deser(
13494 _version: MavlinkVersion,
13495 __input: &[u8],
13496 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13497 let avail_len = __input.len();
13498 let mut payload_buf = [0; Self::ENCODED_LEN];
13499 let mut buf = if avail_len < Self::ENCODED_LEN {
13500 payload_buf[0..avail_len].copy_from_slice(__input);
13501 Bytes::new(&payload_buf)
13502 } else {
13503 Bytes::new(__input)
13504 };
13505 let mut __struct = Self::default();
13506 __struct.time_usec = buf.get_u64_le();
13507 __struct.lat = buf.get_i32_le();
13508 __struct.lon = buf.get_i32_le();
13509 __struct.alt = buf.get_i32_le();
13510 __struct.relative_alt = buf.get_i32_le();
13511 __struct.vx = buf.get_f32_le();
13512 __struct.vy = buf.get_f32_le();
13513 __struct.vz = buf.get_f32_le();
13514 for v in &mut __struct.covariance {
13515 let val = buf.get_f32_le();
13516 *v = val;
13517 }
13518 let tmp = buf.get_u8();
13519 __struct.estimator_type =
13520 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13521 enum_type: "MavEstimatorType",
13522 value: tmp as u64,
13523 })?;
13524 Ok(__struct)
13525 }
13526 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13527 let mut __tmp = BytesMut::new(bytes);
13528 #[allow(clippy::absurd_extreme_comparisons)]
13529 #[allow(unused_comparisons)]
13530 if __tmp.remaining() < Self::ENCODED_LEN {
13531 panic!(
13532 "buffer is too small (need {} bytes, but got {})",
13533 Self::ENCODED_LEN,
13534 __tmp.remaining(),
13535 )
13536 }
13537 __tmp.put_u64_le(self.time_usec);
13538 __tmp.put_i32_le(self.lat);
13539 __tmp.put_i32_le(self.lon);
13540 __tmp.put_i32_le(self.alt);
13541 __tmp.put_i32_le(self.relative_alt);
13542 __tmp.put_f32_le(self.vx);
13543 __tmp.put_f32_le(self.vy);
13544 __tmp.put_f32_le(self.vz);
13545 for val in &self.covariance {
13546 __tmp.put_f32_le(*val);
13547 }
13548 __tmp.put_u8(self.estimator_type as u8);
13549 if matches!(version, MavlinkVersion::V2) {
13550 let len = __tmp.len();
13551 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13552 } else {
13553 __tmp.len()
13554 }
13555 }
13556}
13557#[doc = "Global position/attitude estimate from a vision source."]
13558#[doc = ""]
13559#[doc = "ID: 101"]
13560#[derive(Debug, Clone, PartialEq)]
13561#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13562#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13563#[cfg_attr(feature = "ts", derive(TS))]
13564#[cfg_attr(feature = "ts", ts(export))]
13565pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13566 #[doc = "Timestamp (UNIX time or since system boot)"]
13567 pub usec: u64,
13568 #[doc = "Global X position"]
13569 pub x: f32,
13570 #[doc = "Global Y position"]
13571 pub y: f32,
13572 #[doc = "Global Z position"]
13573 pub z: f32,
13574 #[doc = "Roll angle"]
13575 pub roll: f32,
13576 #[doc = "Pitch angle"]
13577 pub pitch: f32,
13578 #[doc = "Yaw angle"]
13579 pub yaw: f32,
13580 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13581 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13582 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13583 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13584 pub covariance: [f32; 21],
13585 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13586 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13587 pub reset_counter: u8,
13588}
13589impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13590 pub const ENCODED_LEN: usize = 117usize;
13591 pub const DEFAULT: Self = Self {
13592 usec: 0_u64,
13593 x: 0.0_f32,
13594 y: 0.0_f32,
13595 z: 0.0_f32,
13596 roll: 0.0_f32,
13597 pitch: 0.0_f32,
13598 yaw: 0.0_f32,
13599 covariance: [0.0_f32; 21usize],
13600 reset_counter: 0_u8,
13601 };
13602 #[cfg(feature = "arbitrary")]
13603 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13604 use arbitrary::{Arbitrary, Unstructured};
13605 let mut buf = [0u8; 1024];
13606 rng.fill_bytes(&mut buf);
13607 let mut unstructured = Unstructured::new(&buf);
13608 Self::arbitrary(&mut unstructured).unwrap_or_default()
13609 }
13610}
13611impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13612 fn default() -> Self {
13613 Self::DEFAULT.clone()
13614 }
13615}
13616impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13617 type Message = MavMessage;
13618 const ID: u32 = 101u32;
13619 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13620 const EXTRA_CRC: u8 = 102u8;
13621 const ENCODED_LEN: usize = 117usize;
13622 fn deser(
13623 _version: MavlinkVersion,
13624 __input: &[u8],
13625 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13626 let avail_len = __input.len();
13627 let mut payload_buf = [0; Self::ENCODED_LEN];
13628 let mut buf = if avail_len < Self::ENCODED_LEN {
13629 payload_buf[0..avail_len].copy_from_slice(__input);
13630 Bytes::new(&payload_buf)
13631 } else {
13632 Bytes::new(__input)
13633 };
13634 let mut __struct = Self::default();
13635 __struct.usec = buf.get_u64_le();
13636 __struct.x = buf.get_f32_le();
13637 __struct.y = buf.get_f32_le();
13638 __struct.z = buf.get_f32_le();
13639 __struct.roll = buf.get_f32_le();
13640 __struct.pitch = buf.get_f32_le();
13641 __struct.yaw = buf.get_f32_le();
13642 for v in &mut __struct.covariance {
13643 let val = buf.get_f32_le();
13644 *v = val;
13645 }
13646 __struct.reset_counter = buf.get_u8();
13647 Ok(__struct)
13648 }
13649 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13650 let mut __tmp = BytesMut::new(bytes);
13651 #[allow(clippy::absurd_extreme_comparisons)]
13652 #[allow(unused_comparisons)]
13653 if __tmp.remaining() < Self::ENCODED_LEN {
13654 panic!(
13655 "buffer is too small (need {} bytes, but got {})",
13656 Self::ENCODED_LEN,
13657 __tmp.remaining(),
13658 )
13659 }
13660 __tmp.put_u64_le(self.usec);
13661 __tmp.put_f32_le(self.x);
13662 __tmp.put_f32_le(self.y);
13663 __tmp.put_f32_le(self.z);
13664 __tmp.put_f32_le(self.roll);
13665 __tmp.put_f32_le(self.pitch);
13666 __tmp.put_f32_le(self.yaw);
13667 if matches!(version, MavlinkVersion::V2) {
13668 for val in &self.covariance {
13669 __tmp.put_f32_le(*val);
13670 }
13671 __tmp.put_u8(self.reset_counter);
13672 let len = __tmp.len();
13673 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13674 } else {
13675 __tmp.len()
13676 }
13677 }
13678}
13679#[doc = "Second GPS data."]
13680#[doc = ""]
13681#[doc = "ID: 124"]
13682#[derive(Debug, Clone, PartialEq)]
13683#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13684#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13685#[cfg_attr(feature = "ts", derive(TS))]
13686#[cfg_attr(feature = "ts", ts(export))]
13687pub struct GPS2_RAW_DATA {
13688 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13689 pub time_usec: u64,
13690 #[doc = "Latitude (WGS84)"]
13691 pub lat: i32,
13692 #[doc = "Longitude (WGS84)"]
13693 pub lon: i32,
13694 #[doc = "Altitude (MSL). Positive for up."]
13695 pub alt: i32,
13696 #[doc = "Age of DGPS info"]
13697 pub dgps_age: u32,
13698 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13699 pub eph: u16,
13700 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13701 pub epv: u16,
13702 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13703 pub vel: u16,
13704 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13705 pub cog: u16,
13706 #[doc = "GPS fix type."]
13707 pub fix_type: GpsFixType,
13708 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13709 pub satellites_visible: u8,
13710 #[doc = "Number of DGPS satellites"]
13711 pub dgps_numch: u8,
13712 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13713 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13714 pub yaw: u16,
13715 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13716 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13717 pub alt_ellipsoid: i32,
13718 #[doc = "Position uncertainty."]
13719 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13720 pub h_acc: u32,
13721 #[doc = "Altitude uncertainty."]
13722 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13723 pub v_acc: u32,
13724 #[doc = "Speed uncertainty."]
13725 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13726 pub vel_acc: u32,
13727 #[doc = "Heading / track uncertainty"]
13728 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13729 pub hdg_acc: u32,
13730}
13731impl GPS2_RAW_DATA {
13732 pub const ENCODED_LEN: usize = 57usize;
13733 pub const DEFAULT: Self = Self {
13734 time_usec: 0_u64,
13735 lat: 0_i32,
13736 lon: 0_i32,
13737 alt: 0_i32,
13738 dgps_age: 0_u32,
13739 eph: 0_u16,
13740 epv: 0_u16,
13741 vel: 0_u16,
13742 cog: 0_u16,
13743 fix_type: GpsFixType::DEFAULT,
13744 satellites_visible: 0_u8,
13745 dgps_numch: 0_u8,
13746 yaw: 0_u16,
13747 alt_ellipsoid: 0_i32,
13748 h_acc: 0_u32,
13749 v_acc: 0_u32,
13750 vel_acc: 0_u32,
13751 hdg_acc: 0_u32,
13752 };
13753 #[cfg(feature = "arbitrary")]
13754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13755 use arbitrary::{Arbitrary, Unstructured};
13756 let mut buf = [0u8; 1024];
13757 rng.fill_bytes(&mut buf);
13758 let mut unstructured = Unstructured::new(&buf);
13759 Self::arbitrary(&mut unstructured).unwrap_or_default()
13760 }
13761}
13762impl Default for GPS2_RAW_DATA {
13763 fn default() -> Self {
13764 Self::DEFAULT.clone()
13765 }
13766}
13767impl MessageData for GPS2_RAW_DATA {
13768 type Message = MavMessage;
13769 const ID: u32 = 124u32;
13770 const NAME: &'static str = "GPS2_RAW";
13771 const EXTRA_CRC: u8 = 87u8;
13772 const ENCODED_LEN: usize = 57usize;
13773 fn deser(
13774 _version: MavlinkVersion,
13775 __input: &[u8],
13776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13777 let avail_len = __input.len();
13778 let mut payload_buf = [0; Self::ENCODED_LEN];
13779 let mut buf = if avail_len < Self::ENCODED_LEN {
13780 payload_buf[0..avail_len].copy_from_slice(__input);
13781 Bytes::new(&payload_buf)
13782 } else {
13783 Bytes::new(__input)
13784 };
13785 let mut __struct = Self::default();
13786 __struct.time_usec = buf.get_u64_le();
13787 __struct.lat = buf.get_i32_le();
13788 __struct.lon = buf.get_i32_le();
13789 __struct.alt = buf.get_i32_le();
13790 __struct.dgps_age = buf.get_u32_le();
13791 __struct.eph = buf.get_u16_le();
13792 __struct.epv = buf.get_u16_le();
13793 __struct.vel = buf.get_u16_le();
13794 __struct.cog = buf.get_u16_le();
13795 let tmp = buf.get_u8();
13796 __struct.fix_type =
13797 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13798 enum_type: "GpsFixType",
13799 value: tmp as u64,
13800 })?;
13801 __struct.satellites_visible = buf.get_u8();
13802 __struct.dgps_numch = buf.get_u8();
13803 __struct.yaw = buf.get_u16_le();
13804 __struct.alt_ellipsoid = buf.get_i32_le();
13805 __struct.h_acc = buf.get_u32_le();
13806 __struct.v_acc = buf.get_u32_le();
13807 __struct.vel_acc = buf.get_u32_le();
13808 __struct.hdg_acc = buf.get_u32_le();
13809 Ok(__struct)
13810 }
13811 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13812 let mut __tmp = BytesMut::new(bytes);
13813 #[allow(clippy::absurd_extreme_comparisons)]
13814 #[allow(unused_comparisons)]
13815 if __tmp.remaining() < Self::ENCODED_LEN {
13816 panic!(
13817 "buffer is too small (need {} bytes, but got {})",
13818 Self::ENCODED_LEN,
13819 __tmp.remaining(),
13820 )
13821 }
13822 __tmp.put_u64_le(self.time_usec);
13823 __tmp.put_i32_le(self.lat);
13824 __tmp.put_i32_le(self.lon);
13825 __tmp.put_i32_le(self.alt);
13826 __tmp.put_u32_le(self.dgps_age);
13827 __tmp.put_u16_le(self.eph);
13828 __tmp.put_u16_le(self.epv);
13829 __tmp.put_u16_le(self.vel);
13830 __tmp.put_u16_le(self.cog);
13831 __tmp.put_u8(self.fix_type as u8);
13832 __tmp.put_u8(self.satellites_visible);
13833 __tmp.put_u8(self.dgps_numch);
13834 if matches!(version, MavlinkVersion::V2) {
13835 __tmp.put_u16_le(self.yaw);
13836 __tmp.put_i32_le(self.alt_ellipsoid);
13837 __tmp.put_u32_le(self.h_acc);
13838 __tmp.put_u32_le(self.v_acc);
13839 __tmp.put_u32_le(self.vel_acc);
13840 __tmp.put_u32_le(self.hdg_acc);
13841 let len = __tmp.len();
13842 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13843 } else {
13844 __tmp.len()
13845 }
13846 }
13847}
13848#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13849#[doc = ""]
13850#[doc = "ID: 128"]
13851#[derive(Debug, Clone, PartialEq)]
13852#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13853#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13854#[cfg_attr(feature = "ts", derive(TS))]
13855#[cfg_attr(feature = "ts", ts(export))]
13856pub struct GPS2_RTK_DATA {
13857 #[doc = "Time since boot of last baseline message received."]
13858 pub time_last_baseline_ms: u32,
13859 #[doc = "GPS Time of Week of last baseline"]
13860 pub tow: u32,
13861 #[doc = "Current baseline in ECEF x or NED north component."]
13862 pub baseline_a_mm: i32,
13863 #[doc = "Current baseline in ECEF y or NED east component."]
13864 pub baseline_b_mm: i32,
13865 #[doc = "Current baseline in ECEF z or NED down component."]
13866 pub baseline_c_mm: i32,
13867 #[doc = "Current estimate of baseline accuracy."]
13868 pub accuracy: u32,
13869 #[doc = "Current number of integer ambiguity hypotheses."]
13870 pub iar_num_hypotheses: i32,
13871 #[doc = "GPS Week Number of last baseline"]
13872 pub wn: u16,
13873 #[doc = "Identification of connected RTK receiver."]
13874 pub rtk_receiver_id: u8,
13875 #[doc = "GPS-specific health report for RTK data."]
13876 pub rtk_health: u8,
13877 #[doc = "Rate of baseline messages being received by GPS"]
13878 pub rtk_rate: u8,
13879 #[doc = "Current number of sats used for RTK calculation."]
13880 pub nsats: u8,
13881 #[doc = "Coordinate system of baseline"]
13882 pub baseline_coords_type: RtkBaselineCoordinateSystem,
13883}
13884impl GPS2_RTK_DATA {
13885 pub const ENCODED_LEN: usize = 35usize;
13886 pub const DEFAULT: Self = Self {
13887 time_last_baseline_ms: 0_u32,
13888 tow: 0_u32,
13889 baseline_a_mm: 0_i32,
13890 baseline_b_mm: 0_i32,
13891 baseline_c_mm: 0_i32,
13892 accuracy: 0_u32,
13893 iar_num_hypotheses: 0_i32,
13894 wn: 0_u16,
13895 rtk_receiver_id: 0_u8,
13896 rtk_health: 0_u8,
13897 rtk_rate: 0_u8,
13898 nsats: 0_u8,
13899 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
13900 };
13901 #[cfg(feature = "arbitrary")]
13902 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13903 use arbitrary::{Arbitrary, Unstructured};
13904 let mut buf = [0u8; 1024];
13905 rng.fill_bytes(&mut buf);
13906 let mut unstructured = Unstructured::new(&buf);
13907 Self::arbitrary(&mut unstructured).unwrap_or_default()
13908 }
13909}
13910impl Default for GPS2_RTK_DATA {
13911 fn default() -> Self {
13912 Self::DEFAULT.clone()
13913 }
13914}
13915impl MessageData for GPS2_RTK_DATA {
13916 type Message = MavMessage;
13917 const ID: u32 = 128u32;
13918 const NAME: &'static str = "GPS2_RTK";
13919 const EXTRA_CRC: u8 = 226u8;
13920 const ENCODED_LEN: usize = 35usize;
13921 fn deser(
13922 _version: MavlinkVersion,
13923 __input: &[u8],
13924 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13925 let avail_len = __input.len();
13926 let mut payload_buf = [0; Self::ENCODED_LEN];
13927 let mut buf = if avail_len < Self::ENCODED_LEN {
13928 payload_buf[0..avail_len].copy_from_slice(__input);
13929 Bytes::new(&payload_buf)
13930 } else {
13931 Bytes::new(__input)
13932 };
13933 let mut __struct = Self::default();
13934 __struct.time_last_baseline_ms = buf.get_u32_le();
13935 __struct.tow = buf.get_u32_le();
13936 __struct.baseline_a_mm = buf.get_i32_le();
13937 __struct.baseline_b_mm = buf.get_i32_le();
13938 __struct.baseline_c_mm = buf.get_i32_le();
13939 __struct.accuracy = buf.get_u32_le();
13940 __struct.iar_num_hypotheses = buf.get_i32_le();
13941 __struct.wn = buf.get_u16_le();
13942 __struct.rtk_receiver_id = buf.get_u8();
13943 __struct.rtk_health = buf.get_u8();
13944 __struct.rtk_rate = buf.get_u8();
13945 __struct.nsats = buf.get_u8();
13946 let tmp = buf.get_u8();
13947 __struct.baseline_coords_type =
13948 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13949 enum_type: "RtkBaselineCoordinateSystem",
13950 value: tmp as u64,
13951 })?;
13952 Ok(__struct)
13953 }
13954 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13955 let mut __tmp = BytesMut::new(bytes);
13956 #[allow(clippy::absurd_extreme_comparisons)]
13957 #[allow(unused_comparisons)]
13958 if __tmp.remaining() < Self::ENCODED_LEN {
13959 panic!(
13960 "buffer is too small (need {} bytes, but got {})",
13961 Self::ENCODED_LEN,
13962 __tmp.remaining(),
13963 )
13964 }
13965 __tmp.put_u32_le(self.time_last_baseline_ms);
13966 __tmp.put_u32_le(self.tow);
13967 __tmp.put_i32_le(self.baseline_a_mm);
13968 __tmp.put_i32_le(self.baseline_b_mm);
13969 __tmp.put_i32_le(self.baseline_c_mm);
13970 __tmp.put_u32_le(self.accuracy);
13971 __tmp.put_i32_le(self.iar_num_hypotheses);
13972 __tmp.put_u16_le(self.wn);
13973 __tmp.put_u8(self.rtk_receiver_id);
13974 __tmp.put_u8(self.rtk_health);
13975 __tmp.put_u8(self.rtk_rate);
13976 __tmp.put_u8(self.nsats);
13977 __tmp.put_u8(self.baseline_coords_type as u8);
13978 if matches!(version, MavlinkVersion::V2) {
13979 let len = __tmp.len();
13980 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13981 } else {
13982 __tmp.len()
13983 }
13984 }
13985}
13986#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
13987#[doc = ""]
13988#[doc = "ID: 49"]
13989#[derive(Debug, Clone, PartialEq)]
13990#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13991#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13992#[cfg_attr(feature = "ts", derive(TS))]
13993#[cfg_attr(feature = "ts", ts(export))]
13994pub struct GPS_GLOBAL_ORIGIN_DATA {
13995 #[doc = "Latitude (WGS84)"]
13996 pub latitude: i32,
13997 #[doc = "Longitude (WGS84)"]
13998 pub longitude: i32,
13999 #[doc = "Altitude (MSL). Positive for up."]
14000 pub altitude: i32,
14001 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14002 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14003 pub time_usec: u64,
14004}
14005impl GPS_GLOBAL_ORIGIN_DATA {
14006 pub const ENCODED_LEN: usize = 20usize;
14007 pub const DEFAULT: Self = Self {
14008 latitude: 0_i32,
14009 longitude: 0_i32,
14010 altitude: 0_i32,
14011 time_usec: 0_u64,
14012 };
14013 #[cfg(feature = "arbitrary")]
14014 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14015 use arbitrary::{Arbitrary, Unstructured};
14016 let mut buf = [0u8; 1024];
14017 rng.fill_bytes(&mut buf);
14018 let mut unstructured = Unstructured::new(&buf);
14019 Self::arbitrary(&mut unstructured).unwrap_or_default()
14020 }
14021}
14022impl Default for GPS_GLOBAL_ORIGIN_DATA {
14023 fn default() -> Self {
14024 Self::DEFAULT.clone()
14025 }
14026}
14027impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
14028 type Message = MavMessage;
14029 const ID: u32 = 49u32;
14030 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
14031 const EXTRA_CRC: u8 = 39u8;
14032 const ENCODED_LEN: usize = 20usize;
14033 fn deser(
14034 _version: MavlinkVersion,
14035 __input: &[u8],
14036 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14037 let avail_len = __input.len();
14038 let mut payload_buf = [0; Self::ENCODED_LEN];
14039 let mut buf = if avail_len < Self::ENCODED_LEN {
14040 payload_buf[0..avail_len].copy_from_slice(__input);
14041 Bytes::new(&payload_buf)
14042 } else {
14043 Bytes::new(__input)
14044 };
14045 let mut __struct = Self::default();
14046 __struct.latitude = buf.get_i32_le();
14047 __struct.longitude = buf.get_i32_le();
14048 __struct.altitude = buf.get_i32_le();
14049 __struct.time_usec = buf.get_u64_le();
14050 Ok(__struct)
14051 }
14052 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14053 let mut __tmp = BytesMut::new(bytes);
14054 #[allow(clippy::absurd_extreme_comparisons)]
14055 #[allow(unused_comparisons)]
14056 if __tmp.remaining() < Self::ENCODED_LEN {
14057 panic!(
14058 "buffer is too small (need {} bytes, but got {})",
14059 Self::ENCODED_LEN,
14060 __tmp.remaining(),
14061 )
14062 }
14063 __tmp.put_i32_le(self.latitude);
14064 __tmp.put_i32_le(self.longitude);
14065 __tmp.put_i32_le(self.altitude);
14066 if matches!(version, MavlinkVersion::V2) {
14067 __tmp.put_u64_le(self.time_usec);
14068 let len = __tmp.len();
14069 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14070 } else {
14071 __tmp.len()
14072 }
14073 }
14074}
14075#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14076#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14077#[doc = ""]
14078#[doc = "ID: 123"]
14079#[derive(Debug, Clone, PartialEq)]
14080#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14081#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14082#[cfg_attr(feature = "ts", derive(TS))]
14083#[cfg_attr(feature = "ts", ts(export))]
14084pub struct GPS_INJECT_DATA_DATA {
14085 #[doc = "System ID"]
14086 pub target_system: u8,
14087 #[doc = "Component ID"]
14088 pub target_component: u8,
14089 #[doc = "Data length"]
14090 pub len: u8,
14091 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14092 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14093 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14094 pub data: [u8; 110],
14095}
14096impl GPS_INJECT_DATA_DATA {
14097 pub const ENCODED_LEN: usize = 113usize;
14098 pub const DEFAULT: Self = Self {
14099 target_system: 0_u8,
14100 target_component: 0_u8,
14101 len: 0_u8,
14102 data: [0_u8; 110usize],
14103 };
14104 #[cfg(feature = "arbitrary")]
14105 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14106 use arbitrary::{Arbitrary, Unstructured};
14107 let mut buf = [0u8; 1024];
14108 rng.fill_bytes(&mut buf);
14109 let mut unstructured = Unstructured::new(&buf);
14110 Self::arbitrary(&mut unstructured).unwrap_or_default()
14111 }
14112}
14113impl Default for GPS_INJECT_DATA_DATA {
14114 fn default() -> Self {
14115 Self::DEFAULT.clone()
14116 }
14117}
14118impl MessageData for GPS_INJECT_DATA_DATA {
14119 type Message = MavMessage;
14120 const ID: u32 = 123u32;
14121 const NAME: &'static str = "GPS_INJECT_DATA";
14122 const EXTRA_CRC: u8 = 250u8;
14123 const ENCODED_LEN: usize = 113usize;
14124 fn deser(
14125 _version: MavlinkVersion,
14126 __input: &[u8],
14127 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14128 let avail_len = __input.len();
14129 let mut payload_buf = [0; Self::ENCODED_LEN];
14130 let mut buf = if avail_len < Self::ENCODED_LEN {
14131 payload_buf[0..avail_len].copy_from_slice(__input);
14132 Bytes::new(&payload_buf)
14133 } else {
14134 Bytes::new(__input)
14135 };
14136 let mut __struct = Self::default();
14137 __struct.target_system = buf.get_u8();
14138 __struct.target_component = buf.get_u8();
14139 __struct.len = buf.get_u8();
14140 for v in &mut __struct.data {
14141 let val = buf.get_u8();
14142 *v = val;
14143 }
14144 Ok(__struct)
14145 }
14146 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14147 let mut __tmp = BytesMut::new(bytes);
14148 #[allow(clippy::absurd_extreme_comparisons)]
14149 #[allow(unused_comparisons)]
14150 if __tmp.remaining() < Self::ENCODED_LEN {
14151 panic!(
14152 "buffer is too small (need {} bytes, but got {})",
14153 Self::ENCODED_LEN,
14154 __tmp.remaining(),
14155 )
14156 }
14157 __tmp.put_u8(self.target_system);
14158 __tmp.put_u8(self.target_component);
14159 __tmp.put_u8(self.len);
14160 for val in &self.data {
14161 __tmp.put_u8(*val);
14162 }
14163 if matches!(version, MavlinkVersion::V2) {
14164 let len = __tmp.len();
14165 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14166 } else {
14167 __tmp.len()
14168 }
14169 }
14170}
14171#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14172#[doc = ""]
14173#[doc = "ID: 232"]
14174#[derive(Debug, Clone, PartialEq)]
14175#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14177#[cfg_attr(feature = "ts", derive(TS))]
14178#[cfg_attr(feature = "ts", ts(export))]
14179pub struct GPS_INPUT_DATA {
14180 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14181 pub time_usec: u64,
14182 #[doc = "GPS time (from start of GPS week)"]
14183 pub time_week_ms: u32,
14184 #[doc = "Latitude (WGS84)"]
14185 pub lat: i32,
14186 #[doc = "Longitude (WGS84)"]
14187 pub lon: i32,
14188 #[doc = "Altitude (MSL). Positive for up."]
14189 pub alt: f32,
14190 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14191 pub hdop: f32,
14192 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14193 pub vdop: f32,
14194 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14195 pub vn: f32,
14196 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14197 pub ve: f32,
14198 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14199 pub vd: f32,
14200 #[doc = "GPS speed accuracy"]
14201 pub speed_accuracy: f32,
14202 #[doc = "GPS horizontal accuracy"]
14203 pub horiz_accuracy: f32,
14204 #[doc = "GPS vertical accuracy"]
14205 pub vert_accuracy: f32,
14206 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14207 pub ignore_flags: GpsInputIgnoreFlags,
14208 #[doc = "GPS week number"]
14209 pub time_week: u16,
14210 #[doc = "ID of the GPS for multiple GPS inputs"]
14211 pub gps_id: u8,
14212 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14213 pub fix_type: u8,
14214 #[doc = "Number of satellites visible."]
14215 pub satellites_visible: u8,
14216 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14217 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14218 pub yaw: u16,
14219}
14220impl GPS_INPUT_DATA {
14221 pub const ENCODED_LEN: usize = 65usize;
14222 pub const DEFAULT: Self = Self {
14223 time_usec: 0_u64,
14224 time_week_ms: 0_u32,
14225 lat: 0_i32,
14226 lon: 0_i32,
14227 alt: 0.0_f32,
14228 hdop: 0.0_f32,
14229 vdop: 0.0_f32,
14230 vn: 0.0_f32,
14231 ve: 0.0_f32,
14232 vd: 0.0_f32,
14233 speed_accuracy: 0.0_f32,
14234 horiz_accuracy: 0.0_f32,
14235 vert_accuracy: 0.0_f32,
14236 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14237 time_week: 0_u16,
14238 gps_id: 0_u8,
14239 fix_type: 0_u8,
14240 satellites_visible: 0_u8,
14241 yaw: 0_u16,
14242 };
14243 #[cfg(feature = "arbitrary")]
14244 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14245 use arbitrary::{Arbitrary, Unstructured};
14246 let mut buf = [0u8; 1024];
14247 rng.fill_bytes(&mut buf);
14248 let mut unstructured = Unstructured::new(&buf);
14249 Self::arbitrary(&mut unstructured).unwrap_or_default()
14250 }
14251}
14252impl Default for GPS_INPUT_DATA {
14253 fn default() -> Self {
14254 Self::DEFAULT.clone()
14255 }
14256}
14257impl MessageData for GPS_INPUT_DATA {
14258 type Message = MavMessage;
14259 const ID: u32 = 232u32;
14260 const NAME: &'static str = "GPS_INPUT";
14261 const EXTRA_CRC: u8 = 151u8;
14262 const ENCODED_LEN: usize = 65usize;
14263 fn deser(
14264 _version: MavlinkVersion,
14265 __input: &[u8],
14266 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14267 let avail_len = __input.len();
14268 let mut payload_buf = [0; Self::ENCODED_LEN];
14269 let mut buf = if avail_len < Self::ENCODED_LEN {
14270 payload_buf[0..avail_len].copy_from_slice(__input);
14271 Bytes::new(&payload_buf)
14272 } else {
14273 Bytes::new(__input)
14274 };
14275 let mut __struct = Self::default();
14276 __struct.time_usec = buf.get_u64_le();
14277 __struct.time_week_ms = buf.get_u32_le();
14278 __struct.lat = buf.get_i32_le();
14279 __struct.lon = buf.get_i32_le();
14280 __struct.alt = buf.get_f32_le();
14281 __struct.hdop = buf.get_f32_le();
14282 __struct.vdop = buf.get_f32_le();
14283 __struct.vn = buf.get_f32_le();
14284 __struct.ve = buf.get_f32_le();
14285 __struct.vd = buf.get_f32_le();
14286 __struct.speed_accuracy = buf.get_f32_le();
14287 __struct.horiz_accuracy = buf.get_f32_le();
14288 __struct.vert_accuracy = buf.get_f32_le();
14289 let tmp = buf.get_u16_le();
14290 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
14291 tmp as <GpsInputIgnoreFlags as Flags>::Bits,
14292 )
14293 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14294 flag_type: "GpsInputIgnoreFlags",
14295 value: tmp as u64,
14296 })?;
14297 __struct.time_week = buf.get_u16_le();
14298 __struct.gps_id = buf.get_u8();
14299 __struct.fix_type = buf.get_u8();
14300 __struct.satellites_visible = buf.get_u8();
14301 __struct.yaw = buf.get_u16_le();
14302 Ok(__struct)
14303 }
14304 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14305 let mut __tmp = BytesMut::new(bytes);
14306 #[allow(clippy::absurd_extreme_comparisons)]
14307 #[allow(unused_comparisons)]
14308 if __tmp.remaining() < Self::ENCODED_LEN {
14309 panic!(
14310 "buffer is too small (need {} bytes, but got {})",
14311 Self::ENCODED_LEN,
14312 __tmp.remaining(),
14313 )
14314 }
14315 __tmp.put_u64_le(self.time_usec);
14316 __tmp.put_u32_le(self.time_week_ms);
14317 __tmp.put_i32_le(self.lat);
14318 __tmp.put_i32_le(self.lon);
14319 __tmp.put_f32_le(self.alt);
14320 __tmp.put_f32_le(self.hdop);
14321 __tmp.put_f32_le(self.vdop);
14322 __tmp.put_f32_le(self.vn);
14323 __tmp.put_f32_le(self.ve);
14324 __tmp.put_f32_le(self.vd);
14325 __tmp.put_f32_le(self.speed_accuracy);
14326 __tmp.put_f32_le(self.horiz_accuracy);
14327 __tmp.put_f32_le(self.vert_accuracy);
14328 __tmp.put_u16_le(self.ignore_flags.bits() as u16);
14329 __tmp.put_u16_le(self.time_week);
14330 __tmp.put_u8(self.gps_id);
14331 __tmp.put_u8(self.fix_type);
14332 __tmp.put_u8(self.satellites_visible);
14333 if matches!(version, MavlinkVersion::V2) {
14334 __tmp.put_u16_le(self.yaw);
14335 let len = __tmp.len();
14336 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14337 } else {
14338 __tmp.len()
14339 }
14340 }
14341}
14342#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14343#[doc = ""]
14344#[doc = "ID: 24"]
14345#[derive(Debug, Clone, PartialEq)]
14346#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14347#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14348#[cfg_attr(feature = "ts", derive(TS))]
14349#[cfg_attr(feature = "ts", ts(export))]
14350pub struct GPS_RAW_INT_DATA {
14351 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14352 pub time_usec: u64,
14353 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14354 pub lat: i32,
14355 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14356 pub lon: i32,
14357 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14358 pub alt: i32,
14359 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14360 pub eph: u16,
14361 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14362 pub epv: u16,
14363 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14364 pub vel: u16,
14365 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14366 pub cog: u16,
14367 #[doc = "GPS fix type."]
14368 pub fix_type: GpsFixType,
14369 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14370 pub satellites_visible: u8,
14371 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14372 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14373 pub alt_ellipsoid: i32,
14374 #[doc = "Position uncertainty."]
14375 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14376 pub h_acc: u32,
14377 #[doc = "Altitude uncertainty."]
14378 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14379 pub v_acc: u32,
14380 #[doc = "Speed uncertainty."]
14381 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14382 pub vel_acc: u32,
14383 #[doc = "Heading / track uncertainty"]
14384 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14385 pub hdg_acc: u32,
14386 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14387 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14388 pub yaw: u16,
14389}
14390impl GPS_RAW_INT_DATA {
14391 pub const ENCODED_LEN: usize = 52usize;
14392 pub const DEFAULT: Self = Self {
14393 time_usec: 0_u64,
14394 lat: 0_i32,
14395 lon: 0_i32,
14396 alt: 0_i32,
14397 eph: 0_u16,
14398 epv: 0_u16,
14399 vel: 0_u16,
14400 cog: 0_u16,
14401 fix_type: GpsFixType::DEFAULT,
14402 satellites_visible: 0_u8,
14403 alt_ellipsoid: 0_i32,
14404 h_acc: 0_u32,
14405 v_acc: 0_u32,
14406 vel_acc: 0_u32,
14407 hdg_acc: 0_u32,
14408 yaw: 0_u16,
14409 };
14410 #[cfg(feature = "arbitrary")]
14411 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14412 use arbitrary::{Arbitrary, Unstructured};
14413 let mut buf = [0u8; 1024];
14414 rng.fill_bytes(&mut buf);
14415 let mut unstructured = Unstructured::new(&buf);
14416 Self::arbitrary(&mut unstructured).unwrap_or_default()
14417 }
14418}
14419impl Default for GPS_RAW_INT_DATA {
14420 fn default() -> Self {
14421 Self::DEFAULT.clone()
14422 }
14423}
14424impl MessageData for GPS_RAW_INT_DATA {
14425 type Message = MavMessage;
14426 const ID: u32 = 24u32;
14427 const NAME: &'static str = "GPS_RAW_INT";
14428 const EXTRA_CRC: u8 = 24u8;
14429 const ENCODED_LEN: usize = 52usize;
14430 fn deser(
14431 _version: MavlinkVersion,
14432 __input: &[u8],
14433 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14434 let avail_len = __input.len();
14435 let mut payload_buf = [0; Self::ENCODED_LEN];
14436 let mut buf = if avail_len < Self::ENCODED_LEN {
14437 payload_buf[0..avail_len].copy_from_slice(__input);
14438 Bytes::new(&payload_buf)
14439 } else {
14440 Bytes::new(__input)
14441 };
14442 let mut __struct = Self::default();
14443 __struct.time_usec = buf.get_u64_le();
14444 __struct.lat = buf.get_i32_le();
14445 __struct.lon = buf.get_i32_le();
14446 __struct.alt = buf.get_i32_le();
14447 __struct.eph = buf.get_u16_le();
14448 __struct.epv = buf.get_u16_le();
14449 __struct.vel = buf.get_u16_le();
14450 __struct.cog = buf.get_u16_le();
14451 let tmp = buf.get_u8();
14452 __struct.fix_type =
14453 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14454 enum_type: "GpsFixType",
14455 value: tmp as u64,
14456 })?;
14457 __struct.satellites_visible = buf.get_u8();
14458 __struct.alt_ellipsoid = buf.get_i32_le();
14459 __struct.h_acc = buf.get_u32_le();
14460 __struct.v_acc = buf.get_u32_le();
14461 __struct.vel_acc = buf.get_u32_le();
14462 __struct.hdg_acc = buf.get_u32_le();
14463 __struct.yaw = buf.get_u16_le();
14464 Ok(__struct)
14465 }
14466 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14467 let mut __tmp = BytesMut::new(bytes);
14468 #[allow(clippy::absurd_extreme_comparisons)]
14469 #[allow(unused_comparisons)]
14470 if __tmp.remaining() < Self::ENCODED_LEN {
14471 panic!(
14472 "buffer is too small (need {} bytes, but got {})",
14473 Self::ENCODED_LEN,
14474 __tmp.remaining(),
14475 )
14476 }
14477 __tmp.put_u64_le(self.time_usec);
14478 __tmp.put_i32_le(self.lat);
14479 __tmp.put_i32_le(self.lon);
14480 __tmp.put_i32_le(self.alt);
14481 __tmp.put_u16_le(self.eph);
14482 __tmp.put_u16_le(self.epv);
14483 __tmp.put_u16_le(self.vel);
14484 __tmp.put_u16_le(self.cog);
14485 __tmp.put_u8(self.fix_type as u8);
14486 __tmp.put_u8(self.satellites_visible);
14487 if matches!(version, MavlinkVersion::V2) {
14488 __tmp.put_i32_le(self.alt_ellipsoid);
14489 __tmp.put_u32_le(self.h_acc);
14490 __tmp.put_u32_le(self.v_acc);
14491 __tmp.put_u32_le(self.vel_acc);
14492 __tmp.put_u32_le(self.hdg_acc);
14493 __tmp.put_u16_le(self.yaw);
14494 let len = __tmp.len();
14495 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14496 } else {
14497 __tmp.len()
14498 }
14499 }
14500}
14501#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14502#[doc = ""]
14503#[doc = "ID: 233"]
14504#[derive(Debug, Clone, PartialEq)]
14505#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14507#[cfg_attr(feature = "ts", derive(TS))]
14508#[cfg_attr(feature = "ts", ts(export))]
14509pub struct GPS_RTCM_DATA_DATA {
14510 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14511 pub flags: u8,
14512 #[doc = "data length"]
14513 pub len: u8,
14514 #[doc = "RTCM message (may be fragmented)"]
14515 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14516 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14517 pub data: [u8; 180],
14518}
14519impl GPS_RTCM_DATA_DATA {
14520 pub const ENCODED_LEN: usize = 182usize;
14521 pub const DEFAULT: Self = Self {
14522 flags: 0_u8,
14523 len: 0_u8,
14524 data: [0_u8; 180usize],
14525 };
14526 #[cfg(feature = "arbitrary")]
14527 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14528 use arbitrary::{Arbitrary, Unstructured};
14529 let mut buf = [0u8; 1024];
14530 rng.fill_bytes(&mut buf);
14531 let mut unstructured = Unstructured::new(&buf);
14532 Self::arbitrary(&mut unstructured).unwrap_or_default()
14533 }
14534}
14535impl Default for GPS_RTCM_DATA_DATA {
14536 fn default() -> Self {
14537 Self::DEFAULT.clone()
14538 }
14539}
14540impl MessageData for GPS_RTCM_DATA_DATA {
14541 type Message = MavMessage;
14542 const ID: u32 = 233u32;
14543 const NAME: &'static str = "GPS_RTCM_DATA";
14544 const EXTRA_CRC: u8 = 35u8;
14545 const ENCODED_LEN: usize = 182usize;
14546 fn deser(
14547 _version: MavlinkVersion,
14548 __input: &[u8],
14549 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14550 let avail_len = __input.len();
14551 let mut payload_buf = [0; Self::ENCODED_LEN];
14552 let mut buf = if avail_len < Self::ENCODED_LEN {
14553 payload_buf[0..avail_len].copy_from_slice(__input);
14554 Bytes::new(&payload_buf)
14555 } else {
14556 Bytes::new(__input)
14557 };
14558 let mut __struct = Self::default();
14559 __struct.flags = buf.get_u8();
14560 __struct.len = buf.get_u8();
14561 for v in &mut __struct.data {
14562 let val = buf.get_u8();
14563 *v = val;
14564 }
14565 Ok(__struct)
14566 }
14567 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14568 let mut __tmp = BytesMut::new(bytes);
14569 #[allow(clippy::absurd_extreme_comparisons)]
14570 #[allow(unused_comparisons)]
14571 if __tmp.remaining() < Self::ENCODED_LEN {
14572 panic!(
14573 "buffer is too small (need {} bytes, but got {})",
14574 Self::ENCODED_LEN,
14575 __tmp.remaining(),
14576 )
14577 }
14578 __tmp.put_u8(self.flags);
14579 __tmp.put_u8(self.len);
14580 for val in &self.data {
14581 __tmp.put_u8(*val);
14582 }
14583 if matches!(version, MavlinkVersion::V2) {
14584 let len = __tmp.len();
14585 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14586 } else {
14587 __tmp.len()
14588 }
14589 }
14590}
14591#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14592#[doc = ""]
14593#[doc = "ID: 127"]
14594#[derive(Debug, Clone, PartialEq)]
14595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14597#[cfg_attr(feature = "ts", derive(TS))]
14598#[cfg_attr(feature = "ts", ts(export))]
14599pub struct GPS_RTK_DATA {
14600 #[doc = "Time since boot of last baseline message received."]
14601 pub time_last_baseline_ms: u32,
14602 #[doc = "GPS Time of Week of last baseline"]
14603 pub tow: u32,
14604 #[doc = "Current baseline in ECEF x or NED north component."]
14605 pub baseline_a_mm: i32,
14606 #[doc = "Current baseline in ECEF y or NED east component."]
14607 pub baseline_b_mm: i32,
14608 #[doc = "Current baseline in ECEF z or NED down component."]
14609 pub baseline_c_mm: i32,
14610 #[doc = "Current estimate of baseline accuracy."]
14611 pub accuracy: u32,
14612 #[doc = "Current number of integer ambiguity hypotheses."]
14613 pub iar_num_hypotheses: i32,
14614 #[doc = "GPS Week Number of last baseline"]
14615 pub wn: u16,
14616 #[doc = "Identification of connected RTK receiver."]
14617 pub rtk_receiver_id: u8,
14618 #[doc = "GPS-specific health report for RTK data."]
14619 pub rtk_health: u8,
14620 #[doc = "Rate of baseline messages being received by GPS"]
14621 pub rtk_rate: u8,
14622 #[doc = "Current number of sats used for RTK calculation."]
14623 pub nsats: u8,
14624 #[doc = "Coordinate system of baseline"]
14625 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14626}
14627impl GPS_RTK_DATA {
14628 pub const ENCODED_LEN: usize = 35usize;
14629 pub const DEFAULT: Self = Self {
14630 time_last_baseline_ms: 0_u32,
14631 tow: 0_u32,
14632 baseline_a_mm: 0_i32,
14633 baseline_b_mm: 0_i32,
14634 baseline_c_mm: 0_i32,
14635 accuracy: 0_u32,
14636 iar_num_hypotheses: 0_i32,
14637 wn: 0_u16,
14638 rtk_receiver_id: 0_u8,
14639 rtk_health: 0_u8,
14640 rtk_rate: 0_u8,
14641 nsats: 0_u8,
14642 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14643 };
14644 #[cfg(feature = "arbitrary")]
14645 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14646 use arbitrary::{Arbitrary, Unstructured};
14647 let mut buf = [0u8; 1024];
14648 rng.fill_bytes(&mut buf);
14649 let mut unstructured = Unstructured::new(&buf);
14650 Self::arbitrary(&mut unstructured).unwrap_or_default()
14651 }
14652}
14653impl Default for GPS_RTK_DATA {
14654 fn default() -> Self {
14655 Self::DEFAULT.clone()
14656 }
14657}
14658impl MessageData for GPS_RTK_DATA {
14659 type Message = MavMessage;
14660 const ID: u32 = 127u32;
14661 const NAME: &'static str = "GPS_RTK";
14662 const EXTRA_CRC: u8 = 25u8;
14663 const ENCODED_LEN: usize = 35usize;
14664 fn deser(
14665 _version: MavlinkVersion,
14666 __input: &[u8],
14667 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14668 let avail_len = __input.len();
14669 let mut payload_buf = [0; Self::ENCODED_LEN];
14670 let mut buf = if avail_len < Self::ENCODED_LEN {
14671 payload_buf[0..avail_len].copy_from_slice(__input);
14672 Bytes::new(&payload_buf)
14673 } else {
14674 Bytes::new(__input)
14675 };
14676 let mut __struct = Self::default();
14677 __struct.time_last_baseline_ms = buf.get_u32_le();
14678 __struct.tow = buf.get_u32_le();
14679 __struct.baseline_a_mm = buf.get_i32_le();
14680 __struct.baseline_b_mm = buf.get_i32_le();
14681 __struct.baseline_c_mm = buf.get_i32_le();
14682 __struct.accuracy = buf.get_u32_le();
14683 __struct.iar_num_hypotheses = buf.get_i32_le();
14684 __struct.wn = buf.get_u16_le();
14685 __struct.rtk_receiver_id = buf.get_u8();
14686 __struct.rtk_health = buf.get_u8();
14687 __struct.rtk_rate = buf.get_u8();
14688 __struct.nsats = buf.get_u8();
14689 let tmp = buf.get_u8();
14690 __struct.baseline_coords_type =
14691 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14692 enum_type: "RtkBaselineCoordinateSystem",
14693 value: tmp as u64,
14694 })?;
14695 Ok(__struct)
14696 }
14697 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14698 let mut __tmp = BytesMut::new(bytes);
14699 #[allow(clippy::absurd_extreme_comparisons)]
14700 #[allow(unused_comparisons)]
14701 if __tmp.remaining() < Self::ENCODED_LEN {
14702 panic!(
14703 "buffer is too small (need {} bytes, but got {})",
14704 Self::ENCODED_LEN,
14705 __tmp.remaining(),
14706 )
14707 }
14708 __tmp.put_u32_le(self.time_last_baseline_ms);
14709 __tmp.put_u32_le(self.tow);
14710 __tmp.put_i32_le(self.baseline_a_mm);
14711 __tmp.put_i32_le(self.baseline_b_mm);
14712 __tmp.put_i32_le(self.baseline_c_mm);
14713 __tmp.put_u32_le(self.accuracy);
14714 __tmp.put_i32_le(self.iar_num_hypotheses);
14715 __tmp.put_u16_le(self.wn);
14716 __tmp.put_u8(self.rtk_receiver_id);
14717 __tmp.put_u8(self.rtk_health);
14718 __tmp.put_u8(self.rtk_rate);
14719 __tmp.put_u8(self.nsats);
14720 __tmp.put_u8(self.baseline_coords_type as u8);
14721 if matches!(version, MavlinkVersion::V2) {
14722 let len = __tmp.len();
14723 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14724 } else {
14725 __tmp.len()
14726 }
14727 }
14728}
14729#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14730#[doc = ""]
14731#[doc = "ID: 25"]
14732#[derive(Debug, Clone, PartialEq)]
14733#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14734#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14735#[cfg_attr(feature = "ts", derive(TS))]
14736#[cfg_attr(feature = "ts", ts(export))]
14737pub struct GPS_STATUS_DATA {
14738 #[doc = "Number of satellites visible"]
14739 pub satellites_visible: u8,
14740 #[doc = "Global satellite ID"]
14741 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14742 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14743 pub satellite_prn: [u8; 20],
14744 #[doc = "0: Satellite not used, 1: used for localization"]
14745 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14746 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14747 pub satellite_used: [u8; 20],
14748 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14749 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14750 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14751 pub satellite_elevation: [u8; 20],
14752 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14753 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14754 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14755 pub satellite_azimuth: [u8; 20],
14756 #[doc = "Signal to noise ratio of satellite"]
14757 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14758 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14759 pub satellite_snr: [u8; 20],
14760}
14761impl GPS_STATUS_DATA {
14762 pub const ENCODED_LEN: usize = 101usize;
14763 pub const DEFAULT: Self = Self {
14764 satellites_visible: 0_u8,
14765 satellite_prn: [0_u8; 20usize],
14766 satellite_used: [0_u8; 20usize],
14767 satellite_elevation: [0_u8; 20usize],
14768 satellite_azimuth: [0_u8; 20usize],
14769 satellite_snr: [0_u8; 20usize],
14770 };
14771 #[cfg(feature = "arbitrary")]
14772 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14773 use arbitrary::{Arbitrary, Unstructured};
14774 let mut buf = [0u8; 1024];
14775 rng.fill_bytes(&mut buf);
14776 let mut unstructured = Unstructured::new(&buf);
14777 Self::arbitrary(&mut unstructured).unwrap_or_default()
14778 }
14779}
14780impl Default for GPS_STATUS_DATA {
14781 fn default() -> Self {
14782 Self::DEFAULT.clone()
14783 }
14784}
14785impl MessageData for GPS_STATUS_DATA {
14786 type Message = MavMessage;
14787 const ID: u32 = 25u32;
14788 const NAME: &'static str = "GPS_STATUS";
14789 const EXTRA_CRC: u8 = 23u8;
14790 const ENCODED_LEN: usize = 101usize;
14791 fn deser(
14792 _version: MavlinkVersion,
14793 __input: &[u8],
14794 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14795 let avail_len = __input.len();
14796 let mut payload_buf = [0; Self::ENCODED_LEN];
14797 let mut buf = if avail_len < Self::ENCODED_LEN {
14798 payload_buf[0..avail_len].copy_from_slice(__input);
14799 Bytes::new(&payload_buf)
14800 } else {
14801 Bytes::new(__input)
14802 };
14803 let mut __struct = Self::default();
14804 __struct.satellites_visible = buf.get_u8();
14805 for v in &mut __struct.satellite_prn {
14806 let val = buf.get_u8();
14807 *v = val;
14808 }
14809 for v in &mut __struct.satellite_used {
14810 let val = buf.get_u8();
14811 *v = val;
14812 }
14813 for v in &mut __struct.satellite_elevation {
14814 let val = buf.get_u8();
14815 *v = val;
14816 }
14817 for v in &mut __struct.satellite_azimuth {
14818 let val = buf.get_u8();
14819 *v = val;
14820 }
14821 for v in &mut __struct.satellite_snr {
14822 let val = buf.get_u8();
14823 *v = val;
14824 }
14825 Ok(__struct)
14826 }
14827 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14828 let mut __tmp = BytesMut::new(bytes);
14829 #[allow(clippy::absurd_extreme_comparisons)]
14830 #[allow(unused_comparisons)]
14831 if __tmp.remaining() < Self::ENCODED_LEN {
14832 panic!(
14833 "buffer is too small (need {} bytes, but got {})",
14834 Self::ENCODED_LEN,
14835 __tmp.remaining(),
14836 )
14837 }
14838 __tmp.put_u8(self.satellites_visible);
14839 for val in &self.satellite_prn {
14840 __tmp.put_u8(*val);
14841 }
14842 for val in &self.satellite_used {
14843 __tmp.put_u8(*val);
14844 }
14845 for val in &self.satellite_elevation {
14846 __tmp.put_u8(*val);
14847 }
14848 for val in &self.satellite_azimuth {
14849 __tmp.put_u8(*val);
14850 }
14851 for val in &self.satellite_snr {
14852 __tmp.put_u8(*val);
14853 }
14854 if matches!(version, MavlinkVersion::V2) {
14855 let len = __tmp.len();
14856 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14857 } else {
14858 __tmp.len()
14859 }
14860 }
14861}
14862#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
14863#[doc = ""]
14864#[doc = "ID: 0"]
14865#[derive(Debug, Clone, PartialEq)]
14866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14867#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14868#[cfg_attr(feature = "ts", derive(TS))]
14869#[cfg_attr(feature = "ts", ts(export))]
14870pub struct HEARTBEAT_DATA {
14871 #[doc = "A bitfield for use for autopilot-specific flags"]
14872 pub custom_mode: u32,
14873 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
14874 pub mavtype: MavType,
14875 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14876 pub autopilot: MavAutopilot,
14877 #[doc = "System mode bitmap."]
14878 pub base_mode: MavModeFlag,
14879 #[doc = "System status flag."]
14880 pub system_status: MavState,
14881 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
14882 pub mavlink_version: u8,
14883}
14884impl HEARTBEAT_DATA {
14885 pub const ENCODED_LEN: usize = 9usize;
14886 pub const DEFAULT: Self = Self {
14887 custom_mode: 0_u32,
14888 mavtype: MavType::DEFAULT,
14889 autopilot: MavAutopilot::DEFAULT,
14890 base_mode: MavModeFlag::DEFAULT,
14891 system_status: MavState::DEFAULT,
14892 mavlink_version: MINOR_MAVLINK_VERSION,
14893 };
14894 #[cfg(feature = "arbitrary")]
14895 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14896 use arbitrary::{Arbitrary, Unstructured};
14897 let mut buf = [0u8; 1024];
14898 rng.fill_bytes(&mut buf);
14899 let mut unstructured = Unstructured::new(&buf);
14900 Self::arbitrary(&mut unstructured).unwrap_or_default()
14901 }
14902}
14903impl Default for HEARTBEAT_DATA {
14904 fn default() -> Self {
14905 Self::DEFAULT.clone()
14906 }
14907}
14908impl MessageData for HEARTBEAT_DATA {
14909 type Message = MavMessage;
14910 const ID: u32 = 0u32;
14911 const NAME: &'static str = "HEARTBEAT";
14912 const EXTRA_CRC: u8 = 50u8;
14913 const ENCODED_LEN: usize = 9usize;
14914 fn deser(
14915 _version: MavlinkVersion,
14916 __input: &[u8],
14917 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14918 let avail_len = __input.len();
14919 let mut payload_buf = [0; Self::ENCODED_LEN];
14920 let mut buf = if avail_len < Self::ENCODED_LEN {
14921 payload_buf[0..avail_len].copy_from_slice(__input);
14922 Bytes::new(&payload_buf)
14923 } else {
14924 Bytes::new(__input)
14925 };
14926 let mut __struct = Self::default();
14927 __struct.custom_mode = buf.get_u32_le();
14928 let tmp = buf.get_u8();
14929 __struct.mavtype =
14930 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14931 enum_type: "MavType",
14932 value: tmp as u64,
14933 })?;
14934 let tmp = buf.get_u8();
14935 __struct.autopilot =
14936 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14937 enum_type: "MavAutopilot",
14938 value: tmp as u64,
14939 })?;
14940 let tmp = buf.get_u8();
14941 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
14942 ::mavlink_core::error::ParserError::InvalidFlag {
14943 flag_type: "MavModeFlag",
14944 value: tmp as u64,
14945 },
14946 )?;
14947 let tmp = buf.get_u8();
14948 __struct.system_status =
14949 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14950 enum_type: "MavState",
14951 value: tmp as u64,
14952 })?;
14953 __struct.mavlink_version = buf.get_u8();
14954 Ok(__struct)
14955 }
14956 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14957 let mut __tmp = BytesMut::new(bytes);
14958 #[allow(clippy::absurd_extreme_comparisons)]
14959 #[allow(unused_comparisons)]
14960 if __tmp.remaining() < Self::ENCODED_LEN {
14961 panic!(
14962 "buffer is too small (need {} bytes, but got {})",
14963 Self::ENCODED_LEN,
14964 __tmp.remaining(),
14965 )
14966 }
14967 __tmp.put_u32_le(self.custom_mode);
14968 __tmp.put_u8(self.mavtype as u8);
14969 __tmp.put_u8(self.autopilot as u8);
14970 __tmp.put_u8(self.base_mode.bits() as u8);
14971 __tmp.put_u8(self.system_status as u8);
14972 __tmp.put_u8(self.mavlink_version);
14973 if matches!(version, MavlinkVersion::V2) {
14974 let len = __tmp.len();
14975 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14976 } else {
14977 __tmp.len()
14978 }
14979 }
14980}
14981#[doc = "The IMU readings in SI units in NED body frame."]
14982#[doc = ""]
14983#[doc = "ID: 105"]
14984#[derive(Debug, Clone, PartialEq)]
14985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14987#[cfg_attr(feature = "ts", derive(TS))]
14988#[cfg_attr(feature = "ts", ts(export))]
14989pub struct HIGHRES_IMU_DATA {
14990 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14991 pub time_usec: u64,
14992 #[doc = "X acceleration"]
14993 pub xacc: f32,
14994 #[doc = "Y acceleration"]
14995 pub yacc: f32,
14996 #[doc = "Z acceleration"]
14997 pub zacc: f32,
14998 #[doc = "Angular speed around X axis"]
14999 pub xgyro: f32,
15000 #[doc = "Angular speed around Y axis"]
15001 pub ygyro: f32,
15002 #[doc = "Angular speed around Z axis"]
15003 pub zgyro: f32,
15004 #[doc = "X Magnetic field"]
15005 pub xmag: f32,
15006 #[doc = "Y Magnetic field"]
15007 pub ymag: f32,
15008 #[doc = "Z Magnetic field"]
15009 pub zmag: f32,
15010 #[doc = "Absolute pressure"]
15011 pub abs_pressure: f32,
15012 #[doc = "Differential pressure"]
15013 pub diff_pressure: f32,
15014 #[doc = "Altitude calculated from pressure"]
15015 pub pressure_alt: f32,
15016 #[doc = "Temperature"]
15017 pub temperature: f32,
15018 #[doc = "Bitmap for fields that have updated since last message"]
15019 pub fields_updated: HighresImuUpdatedFlags,
15020 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15021 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15022 pub id: u8,
15023}
15024impl HIGHRES_IMU_DATA {
15025 pub const ENCODED_LEN: usize = 63usize;
15026 pub const DEFAULT: Self = Self {
15027 time_usec: 0_u64,
15028 xacc: 0.0_f32,
15029 yacc: 0.0_f32,
15030 zacc: 0.0_f32,
15031 xgyro: 0.0_f32,
15032 ygyro: 0.0_f32,
15033 zgyro: 0.0_f32,
15034 xmag: 0.0_f32,
15035 ymag: 0.0_f32,
15036 zmag: 0.0_f32,
15037 abs_pressure: 0.0_f32,
15038 diff_pressure: 0.0_f32,
15039 pressure_alt: 0.0_f32,
15040 temperature: 0.0_f32,
15041 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15042 id: 0_u8,
15043 };
15044 #[cfg(feature = "arbitrary")]
15045 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15046 use arbitrary::{Arbitrary, Unstructured};
15047 let mut buf = [0u8; 1024];
15048 rng.fill_bytes(&mut buf);
15049 let mut unstructured = Unstructured::new(&buf);
15050 Self::arbitrary(&mut unstructured).unwrap_or_default()
15051 }
15052}
15053impl Default for HIGHRES_IMU_DATA {
15054 fn default() -> Self {
15055 Self::DEFAULT.clone()
15056 }
15057}
15058impl MessageData for HIGHRES_IMU_DATA {
15059 type Message = MavMessage;
15060 const ID: u32 = 105u32;
15061 const NAME: &'static str = "HIGHRES_IMU";
15062 const EXTRA_CRC: u8 = 93u8;
15063 const ENCODED_LEN: usize = 63usize;
15064 fn deser(
15065 _version: MavlinkVersion,
15066 __input: &[u8],
15067 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15068 let avail_len = __input.len();
15069 let mut payload_buf = [0; Self::ENCODED_LEN];
15070 let mut buf = if avail_len < Self::ENCODED_LEN {
15071 payload_buf[0..avail_len].copy_from_slice(__input);
15072 Bytes::new(&payload_buf)
15073 } else {
15074 Bytes::new(__input)
15075 };
15076 let mut __struct = Self::default();
15077 __struct.time_usec = buf.get_u64_le();
15078 __struct.xacc = buf.get_f32_le();
15079 __struct.yacc = buf.get_f32_le();
15080 __struct.zacc = buf.get_f32_le();
15081 __struct.xgyro = buf.get_f32_le();
15082 __struct.ygyro = buf.get_f32_le();
15083 __struct.zgyro = buf.get_f32_le();
15084 __struct.xmag = buf.get_f32_le();
15085 __struct.ymag = buf.get_f32_le();
15086 __struct.zmag = buf.get_f32_le();
15087 __struct.abs_pressure = buf.get_f32_le();
15088 __struct.diff_pressure = buf.get_f32_le();
15089 __struct.pressure_alt = buf.get_f32_le();
15090 __struct.temperature = buf.get_f32_le();
15091 let tmp = buf.get_u16_le();
15092 __struct.fields_updated =
15093 HighresImuUpdatedFlags::from_bits(tmp as <HighresImuUpdatedFlags as Flags>::Bits)
15094 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15095 flag_type: "HighresImuUpdatedFlags",
15096 value: tmp as u64,
15097 })?;
15098 __struct.id = buf.get_u8();
15099 Ok(__struct)
15100 }
15101 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15102 let mut __tmp = BytesMut::new(bytes);
15103 #[allow(clippy::absurd_extreme_comparisons)]
15104 #[allow(unused_comparisons)]
15105 if __tmp.remaining() < Self::ENCODED_LEN {
15106 panic!(
15107 "buffer is too small (need {} bytes, but got {})",
15108 Self::ENCODED_LEN,
15109 __tmp.remaining(),
15110 )
15111 }
15112 __tmp.put_u64_le(self.time_usec);
15113 __tmp.put_f32_le(self.xacc);
15114 __tmp.put_f32_le(self.yacc);
15115 __tmp.put_f32_le(self.zacc);
15116 __tmp.put_f32_le(self.xgyro);
15117 __tmp.put_f32_le(self.ygyro);
15118 __tmp.put_f32_le(self.zgyro);
15119 __tmp.put_f32_le(self.xmag);
15120 __tmp.put_f32_le(self.ymag);
15121 __tmp.put_f32_le(self.zmag);
15122 __tmp.put_f32_le(self.abs_pressure);
15123 __tmp.put_f32_le(self.diff_pressure);
15124 __tmp.put_f32_le(self.pressure_alt);
15125 __tmp.put_f32_le(self.temperature);
15126 __tmp.put_u16_le(self.fields_updated.bits() as u16);
15127 if matches!(version, MavlinkVersion::V2) {
15128 __tmp.put_u8(self.id);
15129 let len = __tmp.len();
15130 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15131 } else {
15132 __tmp.len()
15133 }
15134 }
15135}
15136#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15137#[doc = "Message appropriate for high latency connections like Iridium."]
15138#[doc = ""]
15139#[doc = "ID: 234"]
15140#[derive(Debug, Clone, PartialEq)]
15141#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15142#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15143#[cfg_attr(feature = "ts", derive(TS))]
15144#[cfg_attr(feature = "ts", ts(export))]
15145pub struct HIGH_LATENCY_DATA {
15146 #[doc = "A bitfield for use for autopilot-specific flags."]
15147 pub custom_mode: u32,
15148 #[doc = "Latitude"]
15149 pub latitude: i32,
15150 #[doc = "Longitude"]
15151 pub longitude: i32,
15152 #[doc = "roll"]
15153 pub roll: i16,
15154 #[doc = "pitch"]
15155 pub pitch: i16,
15156 #[doc = "heading"]
15157 pub heading: u16,
15158 #[doc = "heading setpoint"]
15159 pub heading_sp: i16,
15160 #[doc = "Altitude above mean sea level"]
15161 pub altitude_amsl: i16,
15162 #[doc = "Altitude setpoint relative to the home position"]
15163 pub altitude_sp: i16,
15164 #[doc = "distance to target"]
15165 pub wp_distance: u16,
15166 #[doc = "Bitmap of enabled system modes."]
15167 pub base_mode: MavModeFlag,
15168 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15169 pub landed_state: MavLandedState,
15170 #[doc = "throttle (percentage)"]
15171 pub throttle: i8,
15172 #[doc = "airspeed"]
15173 pub airspeed: u8,
15174 #[doc = "airspeed setpoint"]
15175 pub airspeed_sp: u8,
15176 #[doc = "groundspeed"]
15177 pub groundspeed: u8,
15178 #[doc = "climb rate"]
15179 pub climb_rate: i8,
15180 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15181 pub gps_nsat: u8,
15182 #[doc = "GPS Fix type."]
15183 pub gps_fix_type: GpsFixType,
15184 #[doc = "Remaining battery (percentage)"]
15185 pub battery_remaining: u8,
15186 #[doc = "Autopilot temperature (degrees C)"]
15187 pub temperature: i8,
15188 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15189 pub temperature_air: i8,
15190 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15191 pub failsafe: u8,
15192 #[doc = "current waypoint number"]
15193 pub wp_num: u8,
15194}
15195impl HIGH_LATENCY_DATA {
15196 pub const ENCODED_LEN: usize = 40usize;
15197 pub const DEFAULT: Self = Self {
15198 custom_mode: 0_u32,
15199 latitude: 0_i32,
15200 longitude: 0_i32,
15201 roll: 0_i16,
15202 pitch: 0_i16,
15203 heading: 0_u16,
15204 heading_sp: 0_i16,
15205 altitude_amsl: 0_i16,
15206 altitude_sp: 0_i16,
15207 wp_distance: 0_u16,
15208 base_mode: MavModeFlag::DEFAULT,
15209 landed_state: MavLandedState::DEFAULT,
15210 throttle: 0_i8,
15211 airspeed: 0_u8,
15212 airspeed_sp: 0_u8,
15213 groundspeed: 0_u8,
15214 climb_rate: 0_i8,
15215 gps_nsat: 0_u8,
15216 gps_fix_type: GpsFixType::DEFAULT,
15217 battery_remaining: 0_u8,
15218 temperature: 0_i8,
15219 temperature_air: 0_i8,
15220 failsafe: 0_u8,
15221 wp_num: 0_u8,
15222 };
15223 #[cfg(feature = "arbitrary")]
15224 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15225 use arbitrary::{Arbitrary, Unstructured};
15226 let mut buf = [0u8; 1024];
15227 rng.fill_bytes(&mut buf);
15228 let mut unstructured = Unstructured::new(&buf);
15229 Self::arbitrary(&mut unstructured).unwrap_or_default()
15230 }
15231}
15232impl Default for HIGH_LATENCY_DATA {
15233 fn default() -> Self {
15234 Self::DEFAULT.clone()
15235 }
15236}
15237impl MessageData for HIGH_LATENCY_DATA {
15238 type Message = MavMessage;
15239 const ID: u32 = 234u32;
15240 const NAME: &'static str = "HIGH_LATENCY";
15241 const EXTRA_CRC: u8 = 150u8;
15242 const ENCODED_LEN: usize = 40usize;
15243 fn deser(
15244 _version: MavlinkVersion,
15245 __input: &[u8],
15246 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15247 let avail_len = __input.len();
15248 let mut payload_buf = [0; Self::ENCODED_LEN];
15249 let mut buf = if avail_len < Self::ENCODED_LEN {
15250 payload_buf[0..avail_len].copy_from_slice(__input);
15251 Bytes::new(&payload_buf)
15252 } else {
15253 Bytes::new(__input)
15254 };
15255 let mut __struct = Self::default();
15256 __struct.custom_mode = buf.get_u32_le();
15257 __struct.latitude = buf.get_i32_le();
15258 __struct.longitude = buf.get_i32_le();
15259 __struct.roll = buf.get_i16_le();
15260 __struct.pitch = buf.get_i16_le();
15261 __struct.heading = buf.get_u16_le();
15262 __struct.heading_sp = buf.get_i16_le();
15263 __struct.altitude_amsl = buf.get_i16_le();
15264 __struct.altitude_sp = buf.get_i16_le();
15265 __struct.wp_distance = buf.get_u16_le();
15266 let tmp = buf.get_u8();
15267 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
15268 ::mavlink_core::error::ParserError::InvalidFlag {
15269 flag_type: "MavModeFlag",
15270 value: tmp as u64,
15271 },
15272 )?;
15273 let tmp = buf.get_u8();
15274 __struct.landed_state =
15275 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15276 enum_type: "MavLandedState",
15277 value: tmp as u64,
15278 })?;
15279 __struct.throttle = buf.get_i8();
15280 __struct.airspeed = buf.get_u8();
15281 __struct.airspeed_sp = buf.get_u8();
15282 __struct.groundspeed = buf.get_u8();
15283 __struct.climb_rate = buf.get_i8();
15284 __struct.gps_nsat = buf.get_u8();
15285 let tmp = buf.get_u8();
15286 __struct.gps_fix_type =
15287 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15288 enum_type: "GpsFixType",
15289 value: tmp as u64,
15290 })?;
15291 __struct.battery_remaining = buf.get_u8();
15292 __struct.temperature = buf.get_i8();
15293 __struct.temperature_air = buf.get_i8();
15294 __struct.failsafe = buf.get_u8();
15295 __struct.wp_num = buf.get_u8();
15296 Ok(__struct)
15297 }
15298 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15299 let mut __tmp = BytesMut::new(bytes);
15300 #[allow(clippy::absurd_extreme_comparisons)]
15301 #[allow(unused_comparisons)]
15302 if __tmp.remaining() < Self::ENCODED_LEN {
15303 panic!(
15304 "buffer is too small (need {} bytes, but got {})",
15305 Self::ENCODED_LEN,
15306 __tmp.remaining(),
15307 )
15308 }
15309 __tmp.put_u32_le(self.custom_mode);
15310 __tmp.put_i32_le(self.latitude);
15311 __tmp.put_i32_le(self.longitude);
15312 __tmp.put_i16_le(self.roll);
15313 __tmp.put_i16_le(self.pitch);
15314 __tmp.put_u16_le(self.heading);
15315 __tmp.put_i16_le(self.heading_sp);
15316 __tmp.put_i16_le(self.altitude_amsl);
15317 __tmp.put_i16_le(self.altitude_sp);
15318 __tmp.put_u16_le(self.wp_distance);
15319 __tmp.put_u8(self.base_mode.bits() as u8);
15320 __tmp.put_u8(self.landed_state as u8);
15321 __tmp.put_i8(self.throttle);
15322 __tmp.put_u8(self.airspeed);
15323 __tmp.put_u8(self.airspeed_sp);
15324 __tmp.put_u8(self.groundspeed);
15325 __tmp.put_i8(self.climb_rate);
15326 __tmp.put_u8(self.gps_nsat);
15327 __tmp.put_u8(self.gps_fix_type as u8);
15328 __tmp.put_u8(self.battery_remaining);
15329 __tmp.put_i8(self.temperature);
15330 __tmp.put_i8(self.temperature_air);
15331 __tmp.put_u8(self.failsafe);
15332 __tmp.put_u8(self.wp_num);
15333 if matches!(version, MavlinkVersion::V2) {
15334 let len = __tmp.len();
15335 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15336 } else {
15337 __tmp.len()
15338 }
15339 }
15340}
15341#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15342#[doc = ""]
15343#[doc = "ID: 235"]
15344#[derive(Debug, Clone, PartialEq)]
15345#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15346#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15347#[cfg_attr(feature = "ts", derive(TS))]
15348#[cfg_attr(feature = "ts", ts(export))]
15349pub struct HIGH_LATENCY2_DATA {
15350 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15351 pub timestamp: u32,
15352 #[doc = "Latitude"]
15353 pub latitude: i32,
15354 #[doc = "Longitude"]
15355 pub longitude: i32,
15356 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15357 pub custom_mode: u16,
15358 #[doc = "Altitude above mean sea level"]
15359 pub altitude: i16,
15360 #[doc = "Altitude setpoint"]
15361 pub target_altitude: i16,
15362 #[doc = "Distance to target waypoint or position"]
15363 pub target_distance: u16,
15364 #[doc = "Current waypoint number"]
15365 pub wp_num: u16,
15366 #[doc = "Bitmap of failure flags."]
15367 pub failure_flags: HlFailureFlag,
15368 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15369 pub mavtype: MavType,
15370 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15371 pub autopilot: MavAutopilot,
15372 #[doc = "Heading"]
15373 pub heading: u8,
15374 #[doc = "Heading setpoint"]
15375 pub target_heading: u8,
15376 #[doc = "Throttle"]
15377 pub throttle: u8,
15378 #[doc = "Airspeed"]
15379 pub airspeed: u8,
15380 #[doc = "Airspeed setpoint"]
15381 pub airspeed_sp: u8,
15382 #[doc = "Groundspeed"]
15383 pub groundspeed: u8,
15384 #[doc = "Windspeed"]
15385 pub windspeed: u8,
15386 #[doc = "Wind heading"]
15387 pub wind_heading: u8,
15388 #[doc = "Maximum error horizontal position since last message"]
15389 pub eph: u8,
15390 #[doc = "Maximum error vertical position since last message"]
15391 pub epv: u8,
15392 #[doc = "Air temperature"]
15393 pub temperature_air: i8,
15394 #[doc = "Maximum climb rate magnitude since last message"]
15395 pub climb_rate: i8,
15396 #[doc = "Battery level (-1 if field not provided)."]
15397 pub battery: i8,
15398 #[doc = "Field for custom payload."]
15399 pub custom0: i8,
15400 #[doc = "Field for custom payload."]
15401 pub custom1: i8,
15402 #[doc = "Field for custom payload."]
15403 pub custom2: i8,
15404}
15405impl HIGH_LATENCY2_DATA {
15406 pub const ENCODED_LEN: usize = 42usize;
15407 pub const DEFAULT: Self = Self {
15408 timestamp: 0_u32,
15409 latitude: 0_i32,
15410 longitude: 0_i32,
15411 custom_mode: 0_u16,
15412 altitude: 0_i16,
15413 target_altitude: 0_i16,
15414 target_distance: 0_u16,
15415 wp_num: 0_u16,
15416 failure_flags: HlFailureFlag::DEFAULT,
15417 mavtype: MavType::DEFAULT,
15418 autopilot: MavAutopilot::DEFAULT,
15419 heading: 0_u8,
15420 target_heading: 0_u8,
15421 throttle: 0_u8,
15422 airspeed: 0_u8,
15423 airspeed_sp: 0_u8,
15424 groundspeed: 0_u8,
15425 windspeed: 0_u8,
15426 wind_heading: 0_u8,
15427 eph: 0_u8,
15428 epv: 0_u8,
15429 temperature_air: 0_i8,
15430 climb_rate: 0_i8,
15431 battery: 0_i8,
15432 custom0: 0_i8,
15433 custom1: 0_i8,
15434 custom2: 0_i8,
15435 };
15436 #[cfg(feature = "arbitrary")]
15437 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15438 use arbitrary::{Arbitrary, Unstructured};
15439 let mut buf = [0u8; 1024];
15440 rng.fill_bytes(&mut buf);
15441 let mut unstructured = Unstructured::new(&buf);
15442 Self::arbitrary(&mut unstructured).unwrap_or_default()
15443 }
15444}
15445impl Default for HIGH_LATENCY2_DATA {
15446 fn default() -> Self {
15447 Self::DEFAULT.clone()
15448 }
15449}
15450impl MessageData for HIGH_LATENCY2_DATA {
15451 type Message = MavMessage;
15452 const ID: u32 = 235u32;
15453 const NAME: &'static str = "HIGH_LATENCY2";
15454 const EXTRA_CRC: u8 = 179u8;
15455 const ENCODED_LEN: usize = 42usize;
15456 fn deser(
15457 _version: MavlinkVersion,
15458 __input: &[u8],
15459 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15460 let avail_len = __input.len();
15461 let mut payload_buf = [0; Self::ENCODED_LEN];
15462 let mut buf = if avail_len < Self::ENCODED_LEN {
15463 payload_buf[0..avail_len].copy_from_slice(__input);
15464 Bytes::new(&payload_buf)
15465 } else {
15466 Bytes::new(__input)
15467 };
15468 let mut __struct = Self::default();
15469 __struct.timestamp = buf.get_u32_le();
15470 __struct.latitude = buf.get_i32_le();
15471 __struct.longitude = buf.get_i32_le();
15472 __struct.custom_mode = buf.get_u16_le();
15473 __struct.altitude = buf.get_i16_le();
15474 __struct.target_altitude = buf.get_i16_le();
15475 __struct.target_distance = buf.get_u16_le();
15476 __struct.wp_num = buf.get_u16_le();
15477 let tmp = buf.get_u16_le();
15478 __struct.failure_flags = HlFailureFlag::from_bits(tmp as <HlFailureFlag as Flags>::Bits)
15479 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15480 flag_type: "HlFailureFlag",
15481 value: tmp as u64,
15482 })?;
15483 let tmp = buf.get_u8();
15484 __struct.mavtype =
15485 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15486 enum_type: "MavType",
15487 value: tmp as u64,
15488 })?;
15489 let tmp = buf.get_u8();
15490 __struct.autopilot =
15491 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15492 enum_type: "MavAutopilot",
15493 value: tmp as u64,
15494 })?;
15495 __struct.heading = buf.get_u8();
15496 __struct.target_heading = buf.get_u8();
15497 __struct.throttle = buf.get_u8();
15498 __struct.airspeed = buf.get_u8();
15499 __struct.airspeed_sp = buf.get_u8();
15500 __struct.groundspeed = buf.get_u8();
15501 __struct.windspeed = buf.get_u8();
15502 __struct.wind_heading = buf.get_u8();
15503 __struct.eph = buf.get_u8();
15504 __struct.epv = buf.get_u8();
15505 __struct.temperature_air = buf.get_i8();
15506 __struct.climb_rate = buf.get_i8();
15507 __struct.battery = buf.get_i8();
15508 __struct.custom0 = buf.get_i8();
15509 __struct.custom1 = buf.get_i8();
15510 __struct.custom2 = buf.get_i8();
15511 Ok(__struct)
15512 }
15513 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15514 let mut __tmp = BytesMut::new(bytes);
15515 #[allow(clippy::absurd_extreme_comparisons)]
15516 #[allow(unused_comparisons)]
15517 if __tmp.remaining() < Self::ENCODED_LEN {
15518 panic!(
15519 "buffer is too small (need {} bytes, but got {})",
15520 Self::ENCODED_LEN,
15521 __tmp.remaining(),
15522 )
15523 }
15524 __tmp.put_u32_le(self.timestamp);
15525 __tmp.put_i32_le(self.latitude);
15526 __tmp.put_i32_le(self.longitude);
15527 __tmp.put_u16_le(self.custom_mode);
15528 __tmp.put_i16_le(self.altitude);
15529 __tmp.put_i16_le(self.target_altitude);
15530 __tmp.put_u16_le(self.target_distance);
15531 __tmp.put_u16_le(self.wp_num);
15532 __tmp.put_u16_le(self.failure_flags.bits() as u16);
15533 __tmp.put_u8(self.mavtype as u8);
15534 __tmp.put_u8(self.autopilot as u8);
15535 __tmp.put_u8(self.heading);
15536 __tmp.put_u8(self.target_heading);
15537 __tmp.put_u8(self.throttle);
15538 __tmp.put_u8(self.airspeed);
15539 __tmp.put_u8(self.airspeed_sp);
15540 __tmp.put_u8(self.groundspeed);
15541 __tmp.put_u8(self.windspeed);
15542 __tmp.put_u8(self.wind_heading);
15543 __tmp.put_u8(self.eph);
15544 __tmp.put_u8(self.epv);
15545 __tmp.put_i8(self.temperature_air);
15546 __tmp.put_i8(self.climb_rate);
15547 __tmp.put_i8(self.battery);
15548 __tmp.put_i8(self.custom0);
15549 __tmp.put_i8(self.custom1);
15550 __tmp.put_i8(self.custom2);
15551 if matches!(version, MavlinkVersion::V2) {
15552 let len = __tmp.len();
15553 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15554 } else {
15555 __tmp.len()
15556 }
15557 }
15558}
15559#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15560#[doc = ""]
15561#[doc = "ID: 93"]
15562#[derive(Debug, Clone, PartialEq)]
15563#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15564#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15565#[cfg_attr(feature = "ts", derive(TS))]
15566#[cfg_attr(feature = "ts", ts(export))]
15567pub struct HIL_ACTUATOR_CONTROLS_DATA {
15568 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15569 pub time_usec: u64,
15570 #[doc = "Flags bitmask."]
15571 pub flags: HilActuatorControlsFlags,
15572 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15573 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15574 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15575 pub controls: [f32; 16],
15576 #[doc = "System mode. Includes arming state."]
15577 pub mode: MavModeFlag,
15578}
15579impl HIL_ACTUATOR_CONTROLS_DATA {
15580 pub const ENCODED_LEN: usize = 81usize;
15581 pub const DEFAULT: Self = Self {
15582 time_usec: 0_u64,
15583 flags: HilActuatorControlsFlags::DEFAULT,
15584 controls: [0.0_f32; 16usize],
15585 mode: MavModeFlag::DEFAULT,
15586 };
15587 #[cfg(feature = "arbitrary")]
15588 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15589 use arbitrary::{Arbitrary, Unstructured};
15590 let mut buf = [0u8; 1024];
15591 rng.fill_bytes(&mut buf);
15592 let mut unstructured = Unstructured::new(&buf);
15593 Self::arbitrary(&mut unstructured).unwrap_or_default()
15594 }
15595}
15596impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15597 fn default() -> Self {
15598 Self::DEFAULT.clone()
15599 }
15600}
15601impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15602 type Message = MavMessage;
15603 const ID: u32 = 93u32;
15604 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15605 const EXTRA_CRC: u8 = 47u8;
15606 const ENCODED_LEN: usize = 81usize;
15607 fn deser(
15608 _version: MavlinkVersion,
15609 __input: &[u8],
15610 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15611 let avail_len = __input.len();
15612 let mut payload_buf = [0; Self::ENCODED_LEN];
15613 let mut buf = if avail_len < Self::ENCODED_LEN {
15614 payload_buf[0..avail_len].copy_from_slice(__input);
15615 Bytes::new(&payload_buf)
15616 } else {
15617 Bytes::new(__input)
15618 };
15619 let mut __struct = Self::default();
15620 __struct.time_usec = buf.get_u64_le();
15621 let tmp = buf.get_u64_le();
15622 __struct.flags =
15623 HilActuatorControlsFlags::from_bits(tmp as <HilActuatorControlsFlags as Flags>::Bits)
15624 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15625 flag_type: "HilActuatorControlsFlags",
15626 value: tmp as u64,
15627 })?;
15628 for v in &mut __struct.controls {
15629 let val = buf.get_f32_le();
15630 *v = val;
15631 }
15632 let tmp = buf.get_u8();
15633 __struct.mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
15634 ::mavlink_core::error::ParserError::InvalidFlag {
15635 flag_type: "MavModeFlag",
15636 value: tmp as u64,
15637 },
15638 )?;
15639 Ok(__struct)
15640 }
15641 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15642 let mut __tmp = BytesMut::new(bytes);
15643 #[allow(clippy::absurd_extreme_comparisons)]
15644 #[allow(unused_comparisons)]
15645 if __tmp.remaining() < Self::ENCODED_LEN {
15646 panic!(
15647 "buffer is too small (need {} bytes, but got {})",
15648 Self::ENCODED_LEN,
15649 __tmp.remaining(),
15650 )
15651 }
15652 __tmp.put_u64_le(self.time_usec);
15653 __tmp.put_u64_le(self.flags.bits() as u64);
15654 for val in &self.controls {
15655 __tmp.put_f32_le(*val);
15656 }
15657 __tmp.put_u8(self.mode.bits() as u8);
15658 if matches!(version, MavlinkVersion::V2) {
15659 let len = __tmp.len();
15660 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15661 } else {
15662 __tmp.len()
15663 }
15664 }
15665}
15666#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15667#[doc = ""]
15668#[doc = "ID: 91"]
15669#[derive(Debug, Clone, PartialEq)]
15670#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15672#[cfg_attr(feature = "ts", derive(TS))]
15673#[cfg_attr(feature = "ts", ts(export))]
15674pub struct HIL_CONTROLS_DATA {
15675 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15676 pub time_usec: u64,
15677 #[doc = "Control output -1 .. 1"]
15678 pub roll_ailerons: f32,
15679 #[doc = "Control output -1 .. 1"]
15680 pub pitch_elevator: f32,
15681 #[doc = "Control output -1 .. 1"]
15682 pub yaw_rudder: f32,
15683 #[doc = "Throttle 0 .. 1"]
15684 pub throttle: f32,
15685 #[doc = "Aux 1, -1 .. 1"]
15686 pub aux1: f32,
15687 #[doc = "Aux 2, -1 .. 1"]
15688 pub aux2: f32,
15689 #[doc = "Aux 3, -1 .. 1"]
15690 pub aux3: f32,
15691 #[doc = "Aux 4, -1 .. 1"]
15692 pub aux4: f32,
15693 #[doc = "System mode."]
15694 pub mode: MavMode,
15695 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15696 pub nav_mode: u8,
15697}
15698impl HIL_CONTROLS_DATA {
15699 pub const ENCODED_LEN: usize = 42usize;
15700 pub const DEFAULT: Self = Self {
15701 time_usec: 0_u64,
15702 roll_ailerons: 0.0_f32,
15703 pitch_elevator: 0.0_f32,
15704 yaw_rudder: 0.0_f32,
15705 throttle: 0.0_f32,
15706 aux1: 0.0_f32,
15707 aux2: 0.0_f32,
15708 aux3: 0.0_f32,
15709 aux4: 0.0_f32,
15710 mode: MavMode::DEFAULT,
15711 nav_mode: 0_u8,
15712 };
15713 #[cfg(feature = "arbitrary")]
15714 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15715 use arbitrary::{Arbitrary, Unstructured};
15716 let mut buf = [0u8; 1024];
15717 rng.fill_bytes(&mut buf);
15718 let mut unstructured = Unstructured::new(&buf);
15719 Self::arbitrary(&mut unstructured).unwrap_or_default()
15720 }
15721}
15722impl Default for HIL_CONTROLS_DATA {
15723 fn default() -> Self {
15724 Self::DEFAULT.clone()
15725 }
15726}
15727impl MessageData for HIL_CONTROLS_DATA {
15728 type Message = MavMessage;
15729 const ID: u32 = 91u32;
15730 const NAME: &'static str = "HIL_CONTROLS";
15731 const EXTRA_CRC: u8 = 63u8;
15732 const ENCODED_LEN: usize = 42usize;
15733 fn deser(
15734 _version: MavlinkVersion,
15735 __input: &[u8],
15736 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15737 let avail_len = __input.len();
15738 let mut payload_buf = [0; Self::ENCODED_LEN];
15739 let mut buf = if avail_len < Self::ENCODED_LEN {
15740 payload_buf[0..avail_len].copy_from_slice(__input);
15741 Bytes::new(&payload_buf)
15742 } else {
15743 Bytes::new(__input)
15744 };
15745 let mut __struct = Self::default();
15746 __struct.time_usec = buf.get_u64_le();
15747 __struct.roll_ailerons = buf.get_f32_le();
15748 __struct.pitch_elevator = buf.get_f32_le();
15749 __struct.yaw_rudder = buf.get_f32_le();
15750 __struct.throttle = buf.get_f32_le();
15751 __struct.aux1 = buf.get_f32_le();
15752 __struct.aux2 = buf.get_f32_le();
15753 __struct.aux3 = buf.get_f32_le();
15754 __struct.aux4 = buf.get_f32_le();
15755 let tmp = buf.get_u8();
15756 __struct.mode =
15757 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15758 enum_type: "MavMode",
15759 value: tmp as u64,
15760 })?;
15761 __struct.nav_mode = buf.get_u8();
15762 Ok(__struct)
15763 }
15764 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15765 let mut __tmp = BytesMut::new(bytes);
15766 #[allow(clippy::absurd_extreme_comparisons)]
15767 #[allow(unused_comparisons)]
15768 if __tmp.remaining() < Self::ENCODED_LEN {
15769 panic!(
15770 "buffer is too small (need {} bytes, but got {})",
15771 Self::ENCODED_LEN,
15772 __tmp.remaining(),
15773 )
15774 }
15775 __tmp.put_u64_le(self.time_usec);
15776 __tmp.put_f32_le(self.roll_ailerons);
15777 __tmp.put_f32_le(self.pitch_elevator);
15778 __tmp.put_f32_le(self.yaw_rudder);
15779 __tmp.put_f32_le(self.throttle);
15780 __tmp.put_f32_le(self.aux1);
15781 __tmp.put_f32_le(self.aux2);
15782 __tmp.put_f32_le(self.aux3);
15783 __tmp.put_f32_le(self.aux4);
15784 __tmp.put_u8(self.mode as u8);
15785 __tmp.put_u8(self.nav_mode);
15786 if matches!(version, MavlinkVersion::V2) {
15787 let len = __tmp.len();
15788 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15789 } else {
15790 __tmp.len()
15791 }
15792 }
15793}
15794#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15795#[doc = ""]
15796#[doc = "ID: 113"]
15797#[derive(Debug, Clone, PartialEq)]
15798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15799#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15800#[cfg_attr(feature = "ts", derive(TS))]
15801#[cfg_attr(feature = "ts", ts(export))]
15802pub struct HIL_GPS_DATA {
15803 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15804 pub time_usec: u64,
15805 #[doc = "Latitude (WGS84)"]
15806 pub lat: i32,
15807 #[doc = "Longitude (WGS84)"]
15808 pub lon: i32,
15809 #[doc = "Altitude (MSL). Positive for up."]
15810 pub alt: i32,
15811 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15812 pub eph: u16,
15813 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15814 pub epv: u16,
15815 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15816 pub vel: u16,
15817 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15818 pub vn: i16,
15819 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15820 pub ve: i16,
15821 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15822 pub vd: i16,
15823 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15824 pub cog: u16,
15825 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
15826 pub fix_type: u8,
15827 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15828 pub satellites_visible: u8,
15829 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
15830 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15831 pub id: u8,
15832 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15833 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15834 pub yaw: u16,
15835}
15836impl HIL_GPS_DATA {
15837 pub const ENCODED_LEN: usize = 39usize;
15838 pub const DEFAULT: Self = Self {
15839 time_usec: 0_u64,
15840 lat: 0_i32,
15841 lon: 0_i32,
15842 alt: 0_i32,
15843 eph: 0_u16,
15844 epv: 0_u16,
15845 vel: 0_u16,
15846 vn: 0_i16,
15847 ve: 0_i16,
15848 vd: 0_i16,
15849 cog: 0_u16,
15850 fix_type: 0_u8,
15851 satellites_visible: 0_u8,
15852 id: 0_u8,
15853 yaw: 0_u16,
15854 };
15855 #[cfg(feature = "arbitrary")]
15856 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15857 use arbitrary::{Arbitrary, Unstructured};
15858 let mut buf = [0u8; 1024];
15859 rng.fill_bytes(&mut buf);
15860 let mut unstructured = Unstructured::new(&buf);
15861 Self::arbitrary(&mut unstructured).unwrap_or_default()
15862 }
15863}
15864impl Default for HIL_GPS_DATA {
15865 fn default() -> Self {
15866 Self::DEFAULT.clone()
15867 }
15868}
15869impl MessageData for HIL_GPS_DATA {
15870 type Message = MavMessage;
15871 const ID: u32 = 113u32;
15872 const NAME: &'static str = "HIL_GPS";
15873 const EXTRA_CRC: u8 = 124u8;
15874 const ENCODED_LEN: usize = 39usize;
15875 fn deser(
15876 _version: MavlinkVersion,
15877 __input: &[u8],
15878 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15879 let avail_len = __input.len();
15880 let mut payload_buf = [0; Self::ENCODED_LEN];
15881 let mut buf = if avail_len < Self::ENCODED_LEN {
15882 payload_buf[0..avail_len].copy_from_slice(__input);
15883 Bytes::new(&payload_buf)
15884 } else {
15885 Bytes::new(__input)
15886 };
15887 let mut __struct = Self::default();
15888 __struct.time_usec = buf.get_u64_le();
15889 __struct.lat = buf.get_i32_le();
15890 __struct.lon = buf.get_i32_le();
15891 __struct.alt = buf.get_i32_le();
15892 __struct.eph = buf.get_u16_le();
15893 __struct.epv = buf.get_u16_le();
15894 __struct.vel = buf.get_u16_le();
15895 __struct.vn = buf.get_i16_le();
15896 __struct.ve = buf.get_i16_le();
15897 __struct.vd = buf.get_i16_le();
15898 __struct.cog = buf.get_u16_le();
15899 __struct.fix_type = buf.get_u8();
15900 __struct.satellites_visible = buf.get_u8();
15901 __struct.id = buf.get_u8();
15902 __struct.yaw = buf.get_u16_le();
15903 Ok(__struct)
15904 }
15905 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15906 let mut __tmp = BytesMut::new(bytes);
15907 #[allow(clippy::absurd_extreme_comparisons)]
15908 #[allow(unused_comparisons)]
15909 if __tmp.remaining() < Self::ENCODED_LEN {
15910 panic!(
15911 "buffer is too small (need {} bytes, but got {})",
15912 Self::ENCODED_LEN,
15913 __tmp.remaining(),
15914 )
15915 }
15916 __tmp.put_u64_le(self.time_usec);
15917 __tmp.put_i32_le(self.lat);
15918 __tmp.put_i32_le(self.lon);
15919 __tmp.put_i32_le(self.alt);
15920 __tmp.put_u16_le(self.eph);
15921 __tmp.put_u16_le(self.epv);
15922 __tmp.put_u16_le(self.vel);
15923 __tmp.put_i16_le(self.vn);
15924 __tmp.put_i16_le(self.ve);
15925 __tmp.put_i16_le(self.vd);
15926 __tmp.put_u16_le(self.cog);
15927 __tmp.put_u8(self.fix_type);
15928 __tmp.put_u8(self.satellites_visible);
15929 if matches!(version, MavlinkVersion::V2) {
15930 __tmp.put_u8(self.id);
15931 __tmp.put_u16_le(self.yaw);
15932 let len = __tmp.len();
15933 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15934 } else {
15935 __tmp.len()
15936 }
15937 }
15938}
15939#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
15940#[doc = ""]
15941#[doc = "ID: 114"]
15942#[derive(Debug, Clone, PartialEq)]
15943#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15944#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15945#[cfg_attr(feature = "ts", derive(TS))]
15946#[cfg_attr(feature = "ts", ts(export))]
15947pub struct HIL_OPTICAL_FLOW_DATA {
15948 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15949 pub time_usec: u64,
15950 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
15951 pub integration_time_us: u32,
15952 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
15953 pub integrated_x: f32,
15954 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
15955 pub integrated_y: f32,
15956 #[doc = "RH rotation around X axis"]
15957 pub integrated_xgyro: f32,
15958 #[doc = "RH rotation around Y axis"]
15959 pub integrated_ygyro: f32,
15960 #[doc = "RH rotation around Z axis"]
15961 pub integrated_zgyro: f32,
15962 #[doc = "Time since the distance was sampled."]
15963 pub time_delta_distance_us: u32,
15964 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
15965 pub distance: f32,
15966 #[doc = "Temperature"]
15967 pub temperature: i16,
15968 #[doc = "Sensor ID"]
15969 pub sensor_id: u8,
15970 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
15971 pub quality: u8,
15972}
15973impl HIL_OPTICAL_FLOW_DATA {
15974 pub const ENCODED_LEN: usize = 44usize;
15975 pub const DEFAULT: Self = Self {
15976 time_usec: 0_u64,
15977 integration_time_us: 0_u32,
15978 integrated_x: 0.0_f32,
15979 integrated_y: 0.0_f32,
15980 integrated_xgyro: 0.0_f32,
15981 integrated_ygyro: 0.0_f32,
15982 integrated_zgyro: 0.0_f32,
15983 time_delta_distance_us: 0_u32,
15984 distance: 0.0_f32,
15985 temperature: 0_i16,
15986 sensor_id: 0_u8,
15987 quality: 0_u8,
15988 };
15989 #[cfg(feature = "arbitrary")]
15990 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15991 use arbitrary::{Arbitrary, Unstructured};
15992 let mut buf = [0u8; 1024];
15993 rng.fill_bytes(&mut buf);
15994 let mut unstructured = Unstructured::new(&buf);
15995 Self::arbitrary(&mut unstructured).unwrap_or_default()
15996 }
15997}
15998impl Default for HIL_OPTICAL_FLOW_DATA {
15999 fn default() -> Self {
16000 Self::DEFAULT.clone()
16001 }
16002}
16003impl MessageData for HIL_OPTICAL_FLOW_DATA {
16004 type Message = MavMessage;
16005 const ID: u32 = 114u32;
16006 const NAME: &'static str = "HIL_OPTICAL_FLOW";
16007 const EXTRA_CRC: u8 = 237u8;
16008 const ENCODED_LEN: usize = 44usize;
16009 fn deser(
16010 _version: MavlinkVersion,
16011 __input: &[u8],
16012 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16013 let avail_len = __input.len();
16014 let mut payload_buf = [0; Self::ENCODED_LEN];
16015 let mut buf = if avail_len < Self::ENCODED_LEN {
16016 payload_buf[0..avail_len].copy_from_slice(__input);
16017 Bytes::new(&payload_buf)
16018 } else {
16019 Bytes::new(__input)
16020 };
16021 let mut __struct = Self::default();
16022 __struct.time_usec = buf.get_u64_le();
16023 __struct.integration_time_us = buf.get_u32_le();
16024 __struct.integrated_x = buf.get_f32_le();
16025 __struct.integrated_y = buf.get_f32_le();
16026 __struct.integrated_xgyro = buf.get_f32_le();
16027 __struct.integrated_ygyro = buf.get_f32_le();
16028 __struct.integrated_zgyro = buf.get_f32_le();
16029 __struct.time_delta_distance_us = buf.get_u32_le();
16030 __struct.distance = buf.get_f32_le();
16031 __struct.temperature = buf.get_i16_le();
16032 __struct.sensor_id = buf.get_u8();
16033 __struct.quality = buf.get_u8();
16034 Ok(__struct)
16035 }
16036 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16037 let mut __tmp = BytesMut::new(bytes);
16038 #[allow(clippy::absurd_extreme_comparisons)]
16039 #[allow(unused_comparisons)]
16040 if __tmp.remaining() < Self::ENCODED_LEN {
16041 panic!(
16042 "buffer is too small (need {} bytes, but got {})",
16043 Self::ENCODED_LEN,
16044 __tmp.remaining(),
16045 )
16046 }
16047 __tmp.put_u64_le(self.time_usec);
16048 __tmp.put_u32_le(self.integration_time_us);
16049 __tmp.put_f32_le(self.integrated_x);
16050 __tmp.put_f32_le(self.integrated_y);
16051 __tmp.put_f32_le(self.integrated_xgyro);
16052 __tmp.put_f32_le(self.integrated_ygyro);
16053 __tmp.put_f32_le(self.integrated_zgyro);
16054 __tmp.put_u32_le(self.time_delta_distance_us);
16055 __tmp.put_f32_le(self.distance);
16056 __tmp.put_i16_le(self.temperature);
16057 __tmp.put_u8(self.sensor_id);
16058 __tmp.put_u8(self.quality);
16059 if matches!(version, MavlinkVersion::V2) {
16060 let len = __tmp.len();
16061 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16062 } else {
16063 __tmp.len()
16064 }
16065 }
16066}
16067#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
16068#[doc = ""]
16069#[doc = "ID: 92"]
16070#[derive(Debug, Clone, PartialEq)]
16071#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16072#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16073#[cfg_attr(feature = "ts", derive(TS))]
16074#[cfg_attr(feature = "ts", ts(export))]
16075pub struct HIL_RC_INPUTS_RAW_DATA {
16076 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16077 pub time_usec: u64,
16078 #[doc = "RC channel 1 value"]
16079 pub chan1_raw: u16,
16080 #[doc = "RC channel 2 value"]
16081 pub chan2_raw: u16,
16082 #[doc = "RC channel 3 value"]
16083 pub chan3_raw: u16,
16084 #[doc = "RC channel 4 value"]
16085 pub chan4_raw: u16,
16086 #[doc = "RC channel 5 value"]
16087 pub chan5_raw: u16,
16088 #[doc = "RC channel 6 value"]
16089 pub chan6_raw: u16,
16090 #[doc = "RC channel 7 value"]
16091 pub chan7_raw: u16,
16092 #[doc = "RC channel 8 value"]
16093 pub chan8_raw: u16,
16094 #[doc = "RC channel 9 value"]
16095 pub chan9_raw: u16,
16096 #[doc = "RC channel 10 value"]
16097 pub chan10_raw: u16,
16098 #[doc = "RC channel 11 value"]
16099 pub chan11_raw: u16,
16100 #[doc = "RC channel 12 value"]
16101 pub chan12_raw: u16,
16102 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16103 pub rssi: u8,
16104}
16105impl HIL_RC_INPUTS_RAW_DATA {
16106 pub const ENCODED_LEN: usize = 33usize;
16107 pub const DEFAULT: Self = Self {
16108 time_usec: 0_u64,
16109 chan1_raw: 0_u16,
16110 chan2_raw: 0_u16,
16111 chan3_raw: 0_u16,
16112 chan4_raw: 0_u16,
16113 chan5_raw: 0_u16,
16114 chan6_raw: 0_u16,
16115 chan7_raw: 0_u16,
16116 chan8_raw: 0_u16,
16117 chan9_raw: 0_u16,
16118 chan10_raw: 0_u16,
16119 chan11_raw: 0_u16,
16120 chan12_raw: 0_u16,
16121 rssi: 0_u8,
16122 };
16123 #[cfg(feature = "arbitrary")]
16124 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16125 use arbitrary::{Arbitrary, Unstructured};
16126 let mut buf = [0u8; 1024];
16127 rng.fill_bytes(&mut buf);
16128 let mut unstructured = Unstructured::new(&buf);
16129 Self::arbitrary(&mut unstructured).unwrap_or_default()
16130 }
16131}
16132impl Default for HIL_RC_INPUTS_RAW_DATA {
16133 fn default() -> Self {
16134 Self::DEFAULT.clone()
16135 }
16136}
16137impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16138 type Message = MavMessage;
16139 const ID: u32 = 92u32;
16140 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16141 const EXTRA_CRC: u8 = 54u8;
16142 const ENCODED_LEN: usize = 33usize;
16143 fn deser(
16144 _version: MavlinkVersion,
16145 __input: &[u8],
16146 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16147 let avail_len = __input.len();
16148 let mut payload_buf = [0; Self::ENCODED_LEN];
16149 let mut buf = if avail_len < Self::ENCODED_LEN {
16150 payload_buf[0..avail_len].copy_from_slice(__input);
16151 Bytes::new(&payload_buf)
16152 } else {
16153 Bytes::new(__input)
16154 };
16155 let mut __struct = Self::default();
16156 __struct.time_usec = buf.get_u64_le();
16157 __struct.chan1_raw = buf.get_u16_le();
16158 __struct.chan2_raw = buf.get_u16_le();
16159 __struct.chan3_raw = buf.get_u16_le();
16160 __struct.chan4_raw = buf.get_u16_le();
16161 __struct.chan5_raw = buf.get_u16_le();
16162 __struct.chan6_raw = buf.get_u16_le();
16163 __struct.chan7_raw = buf.get_u16_le();
16164 __struct.chan8_raw = buf.get_u16_le();
16165 __struct.chan9_raw = buf.get_u16_le();
16166 __struct.chan10_raw = buf.get_u16_le();
16167 __struct.chan11_raw = buf.get_u16_le();
16168 __struct.chan12_raw = buf.get_u16_le();
16169 __struct.rssi = buf.get_u8();
16170 Ok(__struct)
16171 }
16172 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16173 let mut __tmp = BytesMut::new(bytes);
16174 #[allow(clippy::absurd_extreme_comparisons)]
16175 #[allow(unused_comparisons)]
16176 if __tmp.remaining() < Self::ENCODED_LEN {
16177 panic!(
16178 "buffer is too small (need {} bytes, but got {})",
16179 Self::ENCODED_LEN,
16180 __tmp.remaining(),
16181 )
16182 }
16183 __tmp.put_u64_le(self.time_usec);
16184 __tmp.put_u16_le(self.chan1_raw);
16185 __tmp.put_u16_le(self.chan2_raw);
16186 __tmp.put_u16_le(self.chan3_raw);
16187 __tmp.put_u16_le(self.chan4_raw);
16188 __tmp.put_u16_le(self.chan5_raw);
16189 __tmp.put_u16_le(self.chan6_raw);
16190 __tmp.put_u16_le(self.chan7_raw);
16191 __tmp.put_u16_le(self.chan8_raw);
16192 __tmp.put_u16_le(self.chan9_raw);
16193 __tmp.put_u16_le(self.chan10_raw);
16194 __tmp.put_u16_le(self.chan11_raw);
16195 __tmp.put_u16_le(self.chan12_raw);
16196 __tmp.put_u8(self.rssi);
16197 if matches!(version, MavlinkVersion::V2) {
16198 let len = __tmp.len();
16199 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16200 } else {
16201 __tmp.len()
16202 }
16203 }
16204}
16205#[doc = "The IMU readings in SI units in NED body frame."]
16206#[doc = ""]
16207#[doc = "ID: 107"]
16208#[derive(Debug, Clone, PartialEq)]
16209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16211#[cfg_attr(feature = "ts", derive(TS))]
16212#[cfg_attr(feature = "ts", ts(export))]
16213pub struct HIL_SENSOR_DATA {
16214 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16215 pub time_usec: u64,
16216 #[doc = "X acceleration"]
16217 pub xacc: f32,
16218 #[doc = "Y acceleration"]
16219 pub yacc: f32,
16220 #[doc = "Z acceleration"]
16221 pub zacc: f32,
16222 #[doc = "Angular speed around X axis in body frame"]
16223 pub xgyro: f32,
16224 #[doc = "Angular speed around Y axis in body frame"]
16225 pub ygyro: f32,
16226 #[doc = "Angular speed around Z axis in body frame"]
16227 pub zgyro: f32,
16228 #[doc = "X Magnetic field"]
16229 pub xmag: f32,
16230 #[doc = "Y Magnetic field"]
16231 pub ymag: f32,
16232 #[doc = "Z Magnetic field"]
16233 pub zmag: f32,
16234 #[doc = "Absolute pressure"]
16235 pub abs_pressure: f32,
16236 #[doc = "Differential pressure (airspeed)"]
16237 pub diff_pressure: f32,
16238 #[doc = "Altitude calculated from pressure"]
16239 pub pressure_alt: f32,
16240 #[doc = "Temperature"]
16241 pub temperature: f32,
16242 #[doc = "Bitmap for fields that have updated since last message"]
16243 pub fields_updated: HilSensorUpdatedFlags,
16244 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16245 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16246 pub id: u8,
16247}
16248impl HIL_SENSOR_DATA {
16249 pub const ENCODED_LEN: usize = 65usize;
16250 pub const DEFAULT: Self = Self {
16251 time_usec: 0_u64,
16252 xacc: 0.0_f32,
16253 yacc: 0.0_f32,
16254 zacc: 0.0_f32,
16255 xgyro: 0.0_f32,
16256 ygyro: 0.0_f32,
16257 zgyro: 0.0_f32,
16258 xmag: 0.0_f32,
16259 ymag: 0.0_f32,
16260 zmag: 0.0_f32,
16261 abs_pressure: 0.0_f32,
16262 diff_pressure: 0.0_f32,
16263 pressure_alt: 0.0_f32,
16264 temperature: 0.0_f32,
16265 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16266 id: 0_u8,
16267 };
16268 #[cfg(feature = "arbitrary")]
16269 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16270 use arbitrary::{Arbitrary, Unstructured};
16271 let mut buf = [0u8; 1024];
16272 rng.fill_bytes(&mut buf);
16273 let mut unstructured = Unstructured::new(&buf);
16274 Self::arbitrary(&mut unstructured).unwrap_or_default()
16275 }
16276}
16277impl Default for HIL_SENSOR_DATA {
16278 fn default() -> Self {
16279 Self::DEFAULT.clone()
16280 }
16281}
16282impl MessageData for HIL_SENSOR_DATA {
16283 type Message = MavMessage;
16284 const ID: u32 = 107u32;
16285 const NAME: &'static str = "HIL_SENSOR";
16286 const EXTRA_CRC: u8 = 108u8;
16287 const ENCODED_LEN: usize = 65usize;
16288 fn deser(
16289 _version: MavlinkVersion,
16290 __input: &[u8],
16291 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16292 let avail_len = __input.len();
16293 let mut payload_buf = [0; Self::ENCODED_LEN];
16294 let mut buf = if avail_len < Self::ENCODED_LEN {
16295 payload_buf[0..avail_len].copy_from_slice(__input);
16296 Bytes::new(&payload_buf)
16297 } else {
16298 Bytes::new(__input)
16299 };
16300 let mut __struct = Self::default();
16301 __struct.time_usec = buf.get_u64_le();
16302 __struct.xacc = buf.get_f32_le();
16303 __struct.yacc = buf.get_f32_le();
16304 __struct.zacc = buf.get_f32_le();
16305 __struct.xgyro = buf.get_f32_le();
16306 __struct.ygyro = buf.get_f32_le();
16307 __struct.zgyro = buf.get_f32_le();
16308 __struct.xmag = buf.get_f32_le();
16309 __struct.ymag = buf.get_f32_le();
16310 __struct.zmag = buf.get_f32_le();
16311 __struct.abs_pressure = buf.get_f32_le();
16312 __struct.diff_pressure = buf.get_f32_le();
16313 __struct.pressure_alt = buf.get_f32_le();
16314 __struct.temperature = buf.get_f32_le();
16315 let tmp = buf.get_u32_le();
16316 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
16317 tmp as <HilSensorUpdatedFlags as Flags>::Bits,
16318 )
16319 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16320 flag_type: "HilSensorUpdatedFlags",
16321 value: tmp as u64,
16322 })?;
16323 __struct.id = buf.get_u8();
16324 Ok(__struct)
16325 }
16326 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16327 let mut __tmp = BytesMut::new(bytes);
16328 #[allow(clippy::absurd_extreme_comparisons)]
16329 #[allow(unused_comparisons)]
16330 if __tmp.remaining() < Self::ENCODED_LEN {
16331 panic!(
16332 "buffer is too small (need {} bytes, but got {})",
16333 Self::ENCODED_LEN,
16334 __tmp.remaining(),
16335 )
16336 }
16337 __tmp.put_u64_le(self.time_usec);
16338 __tmp.put_f32_le(self.xacc);
16339 __tmp.put_f32_le(self.yacc);
16340 __tmp.put_f32_le(self.zacc);
16341 __tmp.put_f32_le(self.xgyro);
16342 __tmp.put_f32_le(self.ygyro);
16343 __tmp.put_f32_le(self.zgyro);
16344 __tmp.put_f32_le(self.xmag);
16345 __tmp.put_f32_le(self.ymag);
16346 __tmp.put_f32_le(self.zmag);
16347 __tmp.put_f32_le(self.abs_pressure);
16348 __tmp.put_f32_le(self.diff_pressure);
16349 __tmp.put_f32_le(self.pressure_alt);
16350 __tmp.put_f32_le(self.temperature);
16351 __tmp.put_u32_le(self.fields_updated.bits() as u32);
16352 if matches!(version, MavlinkVersion::V2) {
16353 __tmp.put_u8(self.id);
16354 let len = __tmp.len();
16355 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16356 } else {
16357 __tmp.len()
16358 }
16359 }
16360}
16361#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16362#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16363#[doc = ""]
16364#[doc = "ID: 90"]
16365#[derive(Debug, Clone, PartialEq)]
16366#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16368#[cfg_attr(feature = "ts", derive(TS))]
16369#[cfg_attr(feature = "ts", ts(export))]
16370pub struct HIL_STATE_DATA {
16371 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16372 pub time_usec: u64,
16373 #[doc = "Roll angle"]
16374 pub roll: f32,
16375 #[doc = "Pitch angle"]
16376 pub pitch: f32,
16377 #[doc = "Yaw angle"]
16378 pub yaw: f32,
16379 #[doc = "Body frame roll / phi angular speed"]
16380 pub rollspeed: f32,
16381 #[doc = "Body frame pitch / theta angular speed"]
16382 pub pitchspeed: f32,
16383 #[doc = "Body frame yaw / psi angular speed"]
16384 pub yawspeed: f32,
16385 #[doc = "Latitude"]
16386 pub lat: i32,
16387 #[doc = "Longitude"]
16388 pub lon: i32,
16389 #[doc = "Altitude"]
16390 pub alt: i32,
16391 #[doc = "Ground X Speed (Latitude)"]
16392 pub vx: i16,
16393 #[doc = "Ground Y Speed (Longitude)"]
16394 pub vy: i16,
16395 #[doc = "Ground Z Speed (Altitude)"]
16396 pub vz: i16,
16397 #[doc = "X acceleration"]
16398 pub xacc: i16,
16399 #[doc = "Y acceleration"]
16400 pub yacc: i16,
16401 #[doc = "Z acceleration"]
16402 pub zacc: i16,
16403}
16404impl HIL_STATE_DATA {
16405 pub const ENCODED_LEN: usize = 56usize;
16406 pub const DEFAULT: Self = Self {
16407 time_usec: 0_u64,
16408 roll: 0.0_f32,
16409 pitch: 0.0_f32,
16410 yaw: 0.0_f32,
16411 rollspeed: 0.0_f32,
16412 pitchspeed: 0.0_f32,
16413 yawspeed: 0.0_f32,
16414 lat: 0_i32,
16415 lon: 0_i32,
16416 alt: 0_i32,
16417 vx: 0_i16,
16418 vy: 0_i16,
16419 vz: 0_i16,
16420 xacc: 0_i16,
16421 yacc: 0_i16,
16422 zacc: 0_i16,
16423 };
16424 #[cfg(feature = "arbitrary")]
16425 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16426 use arbitrary::{Arbitrary, Unstructured};
16427 let mut buf = [0u8; 1024];
16428 rng.fill_bytes(&mut buf);
16429 let mut unstructured = Unstructured::new(&buf);
16430 Self::arbitrary(&mut unstructured).unwrap_or_default()
16431 }
16432}
16433impl Default for HIL_STATE_DATA {
16434 fn default() -> Self {
16435 Self::DEFAULT.clone()
16436 }
16437}
16438impl MessageData for HIL_STATE_DATA {
16439 type Message = MavMessage;
16440 const ID: u32 = 90u32;
16441 const NAME: &'static str = "HIL_STATE";
16442 const EXTRA_CRC: u8 = 183u8;
16443 const ENCODED_LEN: usize = 56usize;
16444 fn deser(
16445 _version: MavlinkVersion,
16446 __input: &[u8],
16447 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16448 let avail_len = __input.len();
16449 let mut payload_buf = [0; Self::ENCODED_LEN];
16450 let mut buf = if avail_len < Self::ENCODED_LEN {
16451 payload_buf[0..avail_len].copy_from_slice(__input);
16452 Bytes::new(&payload_buf)
16453 } else {
16454 Bytes::new(__input)
16455 };
16456 let mut __struct = Self::default();
16457 __struct.time_usec = buf.get_u64_le();
16458 __struct.roll = buf.get_f32_le();
16459 __struct.pitch = buf.get_f32_le();
16460 __struct.yaw = buf.get_f32_le();
16461 __struct.rollspeed = buf.get_f32_le();
16462 __struct.pitchspeed = buf.get_f32_le();
16463 __struct.yawspeed = buf.get_f32_le();
16464 __struct.lat = buf.get_i32_le();
16465 __struct.lon = buf.get_i32_le();
16466 __struct.alt = buf.get_i32_le();
16467 __struct.vx = buf.get_i16_le();
16468 __struct.vy = buf.get_i16_le();
16469 __struct.vz = buf.get_i16_le();
16470 __struct.xacc = buf.get_i16_le();
16471 __struct.yacc = buf.get_i16_le();
16472 __struct.zacc = buf.get_i16_le();
16473 Ok(__struct)
16474 }
16475 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16476 let mut __tmp = BytesMut::new(bytes);
16477 #[allow(clippy::absurd_extreme_comparisons)]
16478 #[allow(unused_comparisons)]
16479 if __tmp.remaining() < Self::ENCODED_LEN {
16480 panic!(
16481 "buffer is too small (need {} bytes, but got {})",
16482 Self::ENCODED_LEN,
16483 __tmp.remaining(),
16484 )
16485 }
16486 __tmp.put_u64_le(self.time_usec);
16487 __tmp.put_f32_le(self.roll);
16488 __tmp.put_f32_le(self.pitch);
16489 __tmp.put_f32_le(self.yaw);
16490 __tmp.put_f32_le(self.rollspeed);
16491 __tmp.put_f32_le(self.pitchspeed);
16492 __tmp.put_f32_le(self.yawspeed);
16493 __tmp.put_i32_le(self.lat);
16494 __tmp.put_i32_le(self.lon);
16495 __tmp.put_i32_le(self.alt);
16496 __tmp.put_i16_le(self.vx);
16497 __tmp.put_i16_le(self.vy);
16498 __tmp.put_i16_le(self.vz);
16499 __tmp.put_i16_le(self.xacc);
16500 __tmp.put_i16_le(self.yacc);
16501 __tmp.put_i16_le(self.zacc);
16502 if matches!(version, MavlinkVersion::V2) {
16503 let len = __tmp.len();
16504 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16505 } else {
16506 __tmp.len()
16507 }
16508 }
16509}
16510#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16511#[doc = ""]
16512#[doc = "ID: 115"]
16513#[derive(Debug, Clone, PartialEq)]
16514#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16515#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16516#[cfg_attr(feature = "ts", derive(TS))]
16517#[cfg_attr(feature = "ts", ts(export))]
16518pub struct HIL_STATE_QUATERNION_DATA {
16519 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16520 pub time_usec: u64,
16521 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16522 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16523 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16524 pub attitude_quaternion: [f32; 4],
16525 #[doc = "Body frame roll / phi angular speed"]
16526 pub rollspeed: f32,
16527 #[doc = "Body frame pitch / theta angular speed"]
16528 pub pitchspeed: f32,
16529 #[doc = "Body frame yaw / psi angular speed"]
16530 pub yawspeed: f32,
16531 #[doc = "Latitude"]
16532 pub lat: i32,
16533 #[doc = "Longitude"]
16534 pub lon: i32,
16535 #[doc = "Altitude"]
16536 pub alt: i32,
16537 #[doc = "Ground X Speed (Latitude)"]
16538 pub vx: i16,
16539 #[doc = "Ground Y Speed (Longitude)"]
16540 pub vy: i16,
16541 #[doc = "Ground Z Speed (Altitude)"]
16542 pub vz: i16,
16543 #[doc = "Indicated airspeed"]
16544 pub ind_airspeed: u16,
16545 #[doc = "True airspeed"]
16546 pub true_airspeed: u16,
16547 #[doc = "X acceleration"]
16548 pub xacc: i16,
16549 #[doc = "Y acceleration"]
16550 pub yacc: i16,
16551 #[doc = "Z acceleration"]
16552 pub zacc: i16,
16553}
16554impl HIL_STATE_QUATERNION_DATA {
16555 pub const ENCODED_LEN: usize = 64usize;
16556 pub const DEFAULT: Self = Self {
16557 time_usec: 0_u64,
16558 attitude_quaternion: [0.0_f32; 4usize],
16559 rollspeed: 0.0_f32,
16560 pitchspeed: 0.0_f32,
16561 yawspeed: 0.0_f32,
16562 lat: 0_i32,
16563 lon: 0_i32,
16564 alt: 0_i32,
16565 vx: 0_i16,
16566 vy: 0_i16,
16567 vz: 0_i16,
16568 ind_airspeed: 0_u16,
16569 true_airspeed: 0_u16,
16570 xacc: 0_i16,
16571 yacc: 0_i16,
16572 zacc: 0_i16,
16573 };
16574 #[cfg(feature = "arbitrary")]
16575 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16576 use arbitrary::{Arbitrary, Unstructured};
16577 let mut buf = [0u8; 1024];
16578 rng.fill_bytes(&mut buf);
16579 let mut unstructured = Unstructured::new(&buf);
16580 Self::arbitrary(&mut unstructured).unwrap_or_default()
16581 }
16582}
16583impl Default for HIL_STATE_QUATERNION_DATA {
16584 fn default() -> Self {
16585 Self::DEFAULT.clone()
16586 }
16587}
16588impl MessageData for HIL_STATE_QUATERNION_DATA {
16589 type Message = MavMessage;
16590 const ID: u32 = 115u32;
16591 const NAME: &'static str = "HIL_STATE_QUATERNION";
16592 const EXTRA_CRC: u8 = 4u8;
16593 const ENCODED_LEN: usize = 64usize;
16594 fn deser(
16595 _version: MavlinkVersion,
16596 __input: &[u8],
16597 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16598 let avail_len = __input.len();
16599 let mut payload_buf = [0; Self::ENCODED_LEN];
16600 let mut buf = if avail_len < Self::ENCODED_LEN {
16601 payload_buf[0..avail_len].copy_from_slice(__input);
16602 Bytes::new(&payload_buf)
16603 } else {
16604 Bytes::new(__input)
16605 };
16606 let mut __struct = Self::default();
16607 __struct.time_usec = buf.get_u64_le();
16608 for v in &mut __struct.attitude_quaternion {
16609 let val = buf.get_f32_le();
16610 *v = val;
16611 }
16612 __struct.rollspeed = buf.get_f32_le();
16613 __struct.pitchspeed = buf.get_f32_le();
16614 __struct.yawspeed = buf.get_f32_le();
16615 __struct.lat = buf.get_i32_le();
16616 __struct.lon = buf.get_i32_le();
16617 __struct.alt = buf.get_i32_le();
16618 __struct.vx = buf.get_i16_le();
16619 __struct.vy = buf.get_i16_le();
16620 __struct.vz = buf.get_i16_le();
16621 __struct.ind_airspeed = buf.get_u16_le();
16622 __struct.true_airspeed = buf.get_u16_le();
16623 __struct.xacc = buf.get_i16_le();
16624 __struct.yacc = buf.get_i16_le();
16625 __struct.zacc = buf.get_i16_le();
16626 Ok(__struct)
16627 }
16628 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16629 let mut __tmp = BytesMut::new(bytes);
16630 #[allow(clippy::absurd_extreme_comparisons)]
16631 #[allow(unused_comparisons)]
16632 if __tmp.remaining() < Self::ENCODED_LEN {
16633 panic!(
16634 "buffer is too small (need {} bytes, but got {})",
16635 Self::ENCODED_LEN,
16636 __tmp.remaining(),
16637 )
16638 }
16639 __tmp.put_u64_le(self.time_usec);
16640 for val in &self.attitude_quaternion {
16641 __tmp.put_f32_le(*val);
16642 }
16643 __tmp.put_f32_le(self.rollspeed);
16644 __tmp.put_f32_le(self.pitchspeed);
16645 __tmp.put_f32_le(self.yawspeed);
16646 __tmp.put_i32_le(self.lat);
16647 __tmp.put_i32_le(self.lon);
16648 __tmp.put_i32_le(self.alt);
16649 __tmp.put_i16_le(self.vx);
16650 __tmp.put_i16_le(self.vy);
16651 __tmp.put_i16_le(self.vz);
16652 __tmp.put_u16_le(self.ind_airspeed);
16653 __tmp.put_u16_le(self.true_airspeed);
16654 __tmp.put_i16_le(self.xacc);
16655 __tmp.put_i16_le(self.yacc);
16656 __tmp.put_i16_le(self.zacc);
16657 if matches!(version, MavlinkVersion::V2) {
16658 let len = __tmp.len();
16659 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16660 } else {
16661 __tmp.len()
16662 }
16663 }
16664}
16665#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
16666#[doc = ""]
16667#[doc = "ID: 242"]
16668#[derive(Debug, Clone, PartialEq)]
16669#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16670#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16671#[cfg_attr(feature = "ts", derive(TS))]
16672#[cfg_attr(feature = "ts", ts(export))]
16673pub struct HOME_POSITION_DATA {
16674 #[doc = "Latitude (WGS84)"]
16675 pub latitude: i32,
16676 #[doc = "Longitude (WGS84)"]
16677 pub longitude: i32,
16678 #[doc = "Altitude (MSL). Positive for up."]
16679 pub altitude: i32,
16680 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
16681 pub x: f32,
16682 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16683 pub y: f32,
16684 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16685 pub z: f32,
16686 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16687 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16688 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16689 pub q: [f32; 4],
16690 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16691 pub approach_x: f32,
16692 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16693 pub approach_y: f32,
16694 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16695 pub approach_z: f32,
16696 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16697 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16698 pub time_usec: u64,
16699}
16700impl HOME_POSITION_DATA {
16701 pub const ENCODED_LEN: usize = 60usize;
16702 pub const DEFAULT: Self = Self {
16703 latitude: 0_i32,
16704 longitude: 0_i32,
16705 altitude: 0_i32,
16706 x: 0.0_f32,
16707 y: 0.0_f32,
16708 z: 0.0_f32,
16709 q: [0.0_f32; 4usize],
16710 approach_x: 0.0_f32,
16711 approach_y: 0.0_f32,
16712 approach_z: 0.0_f32,
16713 time_usec: 0_u64,
16714 };
16715 #[cfg(feature = "arbitrary")]
16716 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16717 use arbitrary::{Arbitrary, Unstructured};
16718 let mut buf = [0u8; 1024];
16719 rng.fill_bytes(&mut buf);
16720 let mut unstructured = Unstructured::new(&buf);
16721 Self::arbitrary(&mut unstructured).unwrap_or_default()
16722 }
16723}
16724impl Default for HOME_POSITION_DATA {
16725 fn default() -> Self {
16726 Self::DEFAULT.clone()
16727 }
16728}
16729impl MessageData for HOME_POSITION_DATA {
16730 type Message = MavMessage;
16731 const ID: u32 = 242u32;
16732 const NAME: &'static str = "HOME_POSITION";
16733 const EXTRA_CRC: u8 = 104u8;
16734 const ENCODED_LEN: usize = 60usize;
16735 fn deser(
16736 _version: MavlinkVersion,
16737 __input: &[u8],
16738 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16739 let avail_len = __input.len();
16740 let mut payload_buf = [0; Self::ENCODED_LEN];
16741 let mut buf = if avail_len < Self::ENCODED_LEN {
16742 payload_buf[0..avail_len].copy_from_slice(__input);
16743 Bytes::new(&payload_buf)
16744 } else {
16745 Bytes::new(__input)
16746 };
16747 let mut __struct = Self::default();
16748 __struct.latitude = buf.get_i32_le();
16749 __struct.longitude = buf.get_i32_le();
16750 __struct.altitude = buf.get_i32_le();
16751 __struct.x = buf.get_f32_le();
16752 __struct.y = buf.get_f32_le();
16753 __struct.z = buf.get_f32_le();
16754 for v in &mut __struct.q {
16755 let val = buf.get_f32_le();
16756 *v = val;
16757 }
16758 __struct.approach_x = buf.get_f32_le();
16759 __struct.approach_y = buf.get_f32_le();
16760 __struct.approach_z = buf.get_f32_le();
16761 __struct.time_usec = buf.get_u64_le();
16762 Ok(__struct)
16763 }
16764 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16765 let mut __tmp = BytesMut::new(bytes);
16766 #[allow(clippy::absurd_extreme_comparisons)]
16767 #[allow(unused_comparisons)]
16768 if __tmp.remaining() < Self::ENCODED_LEN {
16769 panic!(
16770 "buffer is too small (need {} bytes, but got {})",
16771 Self::ENCODED_LEN,
16772 __tmp.remaining(),
16773 )
16774 }
16775 __tmp.put_i32_le(self.latitude);
16776 __tmp.put_i32_le(self.longitude);
16777 __tmp.put_i32_le(self.altitude);
16778 __tmp.put_f32_le(self.x);
16779 __tmp.put_f32_le(self.y);
16780 __tmp.put_f32_le(self.z);
16781 for val in &self.q {
16782 __tmp.put_f32_le(*val);
16783 }
16784 __tmp.put_f32_le(self.approach_x);
16785 __tmp.put_f32_le(self.approach_y);
16786 __tmp.put_f32_le(self.approach_z);
16787 if matches!(version, MavlinkVersion::V2) {
16788 __tmp.put_u64_le(self.time_usec);
16789 let len = __tmp.len();
16790 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16791 } else {
16792 __tmp.len()
16793 }
16794 }
16795}
16796#[doc = "Temperature and humidity from hygrometer."]
16797#[doc = ""]
16798#[doc = "ID: 12920"]
16799#[derive(Debug, Clone, PartialEq)]
16800#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16801#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16802#[cfg_attr(feature = "ts", derive(TS))]
16803#[cfg_attr(feature = "ts", ts(export))]
16804pub struct HYGROMETER_SENSOR_DATA {
16805 #[doc = "Temperature"]
16806 pub temperature: i16,
16807 #[doc = "Humidity"]
16808 pub humidity: u16,
16809 #[doc = "Hygrometer ID"]
16810 pub id: u8,
16811}
16812impl HYGROMETER_SENSOR_DATA {
16813 pub const ENCODED_LEN: usize = 5usize;
16814 pub const DEFAULT: Self = Self {
16815 temperature: 0_i16,
16816 humidity: 0_u16,
16817 id: 0_u8,
16818 };
16819 #[cfg(feature = "arbitrary")]
16820 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16821 use arbitrary::{Arbitrary, Unstructured};
16822 let mut buf = [0u8; 1024];
16823 rng.fill_bytes(&mut buf);
16824 let mut unstructured = Unstructured::new(&buf);
16825 Self::arbitrary(&mut unstructured).unwrap_or_default()
16826 }
16827}
16828impl Default for HYGROMETER_SENSOR_DATA {
16829 fn default() -> Self {
16830 Self::DEFAULT.clone()
16831 }
16832}
16833impl MessageData for HYGROMETER_SENSOR_DATA {
16834 type Message = MavMessage;
16835 const ID: u32 = 12920u32;
16836 const NAME: &'static str = "HYGROMETER_SENSOR";
16837 const EXTRA_CRC: u8 = 20u8;
16838 const ENCODED_LEN: usize = 5usize;
16839 fn deser(
16840 _version: MavlinkVersion,
16841 __input: &[u8],
16842 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16843 let avail_len = __input.len();
16844 let mut payload_buf = [0; Self::ENCODED_LEN];
16845 let mut buf = if avail_len < Self::ENCODED_LEN {
16846 payload_buf[0..avail_len].copy_from_slice(__input);
16847 Bytes::new(&payload_buf)
16848 } else {
16849 Bytes::new(__input)
16850 };
16851 let mut __struct = Self::default();
16852 __struct.temperature = buf.get_i16_le();
16853 __struct.humidity = buf.get_u16_le();
16854 __struct.id = buf.get_u8();
16855 Ok(__struct)
16856 }
16857 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16858 let mut __tmp = BytesMut::new(bytes);
16859 #[allow(clippy::absurd_extreme_comparisons)]
16860 #[allow(unused_comparisons)]
16861 if __tmp.remaining() < Self::ENCODED_LEN {
16862 panic!(
16863 "buffer is too small (need {} bytes, but got {})",
16864 Self::ENCODED_LEN,
16865 __tmp.remaining(),
16866 )
16867 }
16868 __tmp.put_i16_le(self.temperature);
16869 __tmp.put_u16_le(self.humidity);
16870 __tmp.put_u8(self.id);
16871 if matches!(version, MavlinkVersion::V2) {
16872 let len = __tmp.len();
16873 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16874 } else {
16875 __tmp.len()
16876 }
16877 }
16878}
16879#[doc = "Illuminator status."]
16880#[doc = ""]
16881#[doc = "ID: 440"]
16882#[derive(Debug, Clone, PartialEq)]
16883#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16884#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16885#[cfg_attr(feature = "ts", derive(TS))]
16886#[cfg_attr(feature = "ts", ts(export))]
16887pub struct ILLUMINATOR_STATUS_DATA {
16888 #[doc = "Time since the start-up of the illuminator in ms"]
16889 pub uptime_ms: u32,
16890 #[doc = "Errors"]
16891 pub error_status: IlluminatorErrorFlags,
16892 #[doc = "Illuminator brightness"]
16893 pub brightness: f32,
16894 #[doc = "Illuminator strobing period in seconds"]
16895 pub strobe_period: f32,
16896 #[doc = "Illuminator strobing duty cycle"]
16897 pub strobe_duty_cycle: f32,
16898 #[doc = "Temperature in Celsius"]
16899 pub temp_c: f32,
16900 #[doc = "Minimum strobing period in seconds"]
16901 pub min_strobe_period: f32,
16902 #[doc = "Maximum strobing period in seconds"]
16903 pub max_strobe_period: f32,
16904 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
16905 pub enable: u8,
16906 #[doc = "Supported illuminator modes"]
16907 pub mode_bitmask: IlluminatorMode,
16908 #[doc = "Illuminator mode"]
16909 pub mode: IlluminatorMode,
16910}
16911impl ILLUMINATOR_STATUS_DATA {
16912 pub const ENCODED_LEN: usize = 35usize;
16913 pub const DEFAULT: Self = Self {
16914 uptime_ms: 0_u32,
16915 error_status: IlluminatorErrorFlags::DEFAULT,
16916 brightness: 0.0_f32,
16917 strobe_period: 0.0_f32,
16918 strobe_duty_cycle: 0.0_f32,
16919 temp_c: 0.0_f32,
16920 min_strobe_period: 0.0_f32,
16921 max_strobe_period: 0.0_f32,
16922 enable: 0_u8,
16923 mode_bitmask: IlluminatorMode::DEFAULT,
16924 mode: IlluminatorMode::DEFAULT,
16925 };
16926 #[cfg(feature = "arbitrary")]
16927 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16928 use arbitrary::{Arbitrary, Unstructured};
16929 let mut buf = [0u8; 1024];
16930 rng.fill_bytes(&mut buf);
16931 let mut unstructured = Unstructured::new(&buf);
16932 Self::arbitrary(&mut unstructured).unwrap_or_default()
16933 }
16934}
16935impl Default for ILLUMINATOR_STATUS_DATA {
16936 fn default() -> Self {
16937 Self::DEFAULT.clone()
16938 }
16939}
16940impl MessageData for ILLUMINATOR_STATUS_DATA {
16941 type Message = MavMessage;
16942 const ID: u32 = 440u32;
16943 const NAME: &'static str = "ILLUMINATOR_STATUS";
16944 const EXTRA_CRC: u8 = 66u8;
16945 const ENCODED_LEN: usize = 35usize;
16946 fn deser(
16947 _version: MavlinkVersion,
16948 __input: &[u8],
16949 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16950 let avail_len = __input.len();
16951 let mut payload_buf = [0; Self::ENCODED_LEN];
16952 let mut buf = if avail_len < Self::ENCODED_LEN {
16953 payload_buf[0..avail_len].copy_from_slice(__input);
16954 Bytes::new(&payload_buf)
16955 } else {
16956 Bytes::new(__input)
16957 };
16958 let mut __struct = Self::default();
16959 __struct.uptime_ms = buf.get_u32_le();
16960 let tmp = buf.get_u32_le();
16961 __struct.error_status = IlluminatorErrorFlags::from_bits(
16962 tmp as <IlluminatorErrorFlags as Flags>::Bits,
16963 )
16964 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16965 flag_type: "IlluminatorErrorFlags",
16966 value: tmp as u64,
16967 })?;
16968 __struct.brightness = buf.get_f32_le();
16969 __struct.strobe_period = buf.get_f32_le();
16970 __struct.strobe_duty_cycle = buf.get_f32_le();
16971 __struct.temp_c = buf.get_f32_le();
16972 __struct.min_strobe_period = buf.get_f32_le();
16973 __struct.max_strobe_period = buf.get_f32_le();
16974 __struct.enable = buf.get_u8();
16975 let tmp = buf.get_u8();
16976 __struct.mode_bitmask =
16977 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16978 enum_type: "IlluminatorMode",
16979 value: tmp as u64,
16980 })?;
16981 let tmp = buf.get_u8();
16982 __struct.mode =
16983 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16984 enum_type: "IlluminatorMode",
16985 value: tmp as u64,
16986 })?;
16987 Ok(__struct)
16988 }
16989 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16990 let mut __tmp = BytesMut::new(bytes);
16991 #[allow(clippy::absurd_extreme_comparisons)]
16992 #[allow(unused_comparisons)]
16993 if __tmp.remaining() < Self::ENCODED_LEN {
16994 panic!(
16995 "buffer is too small (need {} bytes, but got {})",
16996 Self::ENCODED_LEN,
16997 __tmp.remaining(),
16998 )
16999 }
17000 __tmp.put_u32_le(self.uptime_ms);
17001 __tmp.put_u32_le(self.error_status.bits() as u32);
17002 __tmp.put_f32_le(self.brightness);
17003 __tmp.put_f32_le(self.strobe_period);
17004 __tmp.put_f32_le(self.strobe_duty_cycle);
17005 __tmp.put_f32_le(self.temp_c);
17006 __tmp.put_f32_le(self.min_strobe_period);
17007 __tmp.put_f32_le(self.max_strobe_period);
17008 __tmp.put_u8(self.enable);
17009 __tmp.put_u8(self.mode_bitmask as u8);
17010 __tmp.put_u8(self.mode as u8);
17011 if matches!(version, MavlinkVersion::V2) {
17012 let len = __tmp.len();
17013 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17014 } else {
17015 __tmp.len()
17016 }
17017 }
17018}
17019#[doc = "Status of the Iridium SBD link."]
17020#[doc = ""]
17021#[doc = "ID: 335"]
17022#[derive(Debug, Clone, PartialEq)]
17023#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17024#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17025#[cfg_attr(feature = "ts", derive(TS))]
17026#[cfg_attr(feature = "ts", ts(export))]
17027pub struct ISBD_LINK_STATUS_DATA {
17028 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17029 pub timestamp: u64,
17030 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17031 pub last_heartbeat: u64,
17032 #[doc = "Number of failed SBD sessions."]
17033 pub failed_sessions: u16,
17034 #[doc = "Number of successful SBD sessions."]
17035 pub successful_sessions: u16,
17036 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
17037 pub signal_quality: u8,
17038 #[doc = "1: Ring call pending, 0: No call pending."]
17039 pub ring_pending: u8,
17040 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
17041 pub tx_session_pending: u8,
17042 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
17043 pub rx_session_pending: u8,
17044}
17045impl ISBD_LINK_STATUS_DATA {
17046 pub const ENCODED_LEN: usize = 24usize;
17047 pub const DEFAULT: Self = Self {
17048 timestamp: 0_u64,
17049 last_heartbeat: 0_u64,
17050 failed_sessions: 0_u16,
17051 successful_sessions: 0_u16,
17052 signal_quality: 0_u8,
17053 ring_pending: 0_u8,
17054 tx_session_pending: 0_u8,
17055 rx_session_pending: 0_u8,
17056 };
17057 #[cfg(feature = "arbitrary")]
17058 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17059 use arbitrary::{Arbitrary, Unstructured};
17060 let mut buf = [0u8; 1024];
17061 rng.fill_bytes(&mut buf);
17062 let mut unstructured = Unstructured::new(&buf);
17063 Self::arbitrary(&mut unstructured).unwrap_or_default()
17064 }
17065}
17066impl Default for ISBD_LINK_STATUS_DATA {
17067 fn default() -> Self {
17068 Self::DEFAULT.clone()
17069 }
17070}
17071impl MessageData for ISBD_LINK_STATUS_DATA {
17072 type Message = MavMessage;
17073 const ID: u32 = 335u32;
17074 const NAME: &'static str = "ISBD_LINK_STATUS";
17075 const EXTRA_CRC: u8 = 225u8;
17076 const ENCODED_LEN: usize = 24usize;
17077 fn deser(
17078 _version: MavlinkVersion,
17079 __input: &[u8],
17080 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17081 let avail_len = __input.len();
17082 let mut payload_buf = [0; Self::ENCODED_LEN];
17083 let mut buf = if avail_len < Self::ENCODED_LEN {
17084 payload_buf[0..avail_len].copy_from_slice(__input);
17085 Bytes::new(&payload_buf)
17086 } else {
17087 Bytes::new(__input)
17088 };
17089 let mut __struct = Self::default();
17090 __struct.timestamp = buf.get_u64_le();
17091 __struct.last_heartbeat = buf.get_u64_le();
17092 __struct.failed_sessions = buf.get_u16_le();
17093 __struct.successful_sessions = buf.get_u16_le();
17094 __struct.signal_quality = buf.get_u8();
17095 __struct.ring_pending = buf.get_u8();
17096 __struct.tx_session_pending = buf.get_u8();
17097 __struct.rx_session_pending = buf.get_u8();
17098 Ok(__struct)
17099 }
17100 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17101 let mut __tmp = BytesMut::new(bytes);
17102 #[allow(clippy::absurd_extreme_comparisons)]
17103 #[allow(unused_comparisons)]
17104 if __tmp.remaining() < Self::ENCODED_LEN {
17105 panic!(
17106 "buffer is too small (need {} bytes, but got {})",
17107 Self::ENCODED_LEN,
17108 __tmp.remaining(),
17109 )
17110 }
17111 __tmp.put_u64_le(self.timestamp);
17112 __tmp.put_u64_le(self.last_heartbeat);
17113 __tmp.put_u16_le(self.failed_sessions);
17114 __tmp.put_u16_le(self.successful_sessions);
17115 __tmp.put_u8(self.signal_quality);
17116 __tmp.put_u8(self.ring_pending);
17117 __tmp.put_u8(self.tx_session_pending);
17118 __tmp.put_u8(self.rx_session_pending);
17119 if matches!(version, MavlinkVersion::V2) {
17120 let len = __tmp.len();
17121 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17122 } else {
17123 __tmp.len()
17124 }
17125 }
17126}
17127#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17128#[doc = ""]
17129#[doc = "ID: 149"]
17130#[derive(Debug, Clone, PartialEq)]
17131#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17133#[cfg_attr(feature = "ts", derive(TS))]
17134#[cfg_attr(feature = "ts", ts(export))]
17135pub struct LANDING_TARGET_DATA {
17136 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17137 pub time_usec: u64,
17138 #[doc = "X-axis angular offset of the target from the center of the image"]
17139 pub angle_x: f32,
17140 #[doc = "Y-axis angular offset of the target from the center of the image"]
17141 pub angle_y: f32,
17142 #[doc = "Distance to the target from the vehicle"]
17143 pub distance: f32,
17144 #[doc = "Size of target along x-axis"]
17145 pub size_x: f32,
17146 #[doc = "Size of target along y-axis"]
17147 pub size_y: f32,
17148 #[doc = "The ID of the target if multiple targets are present"]
17149 pub target_num: u8,
17150 #[doc = "Coordinate frame used for following fields."]
17151 pub frame: MavFrame,
17152 #[doc = "X Position of the landing target in MAV_FRAME"]
17153 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17154 pub x: f32,
17155 #[doc = "Y Position of the landing target in MAV_FRAME"]
17156 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17157 pub y: f32,
17158 #[doc = "Z Position of the landing target in MAV_FRAME"]
17159 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17160 pub z: f32,
17161 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
17162 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17163 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17164 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17165 pub q: [f32; 4],
17166 #[doc = "Type of landing target"]
17167 #[cfg_attr(feature = "serde", serde(default))]
17168 pub mavtype: LandingTargetType,
17169 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
17170 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17171 pub position_valid: u8,
17172}
17173impl LANDING_TARGET_DATA {
17174 pub const ENCODED_LEN: usize = 60usize;
17175 pub const DEFAULT: Self = Self {
17176 time_usec: 0_u64,
17177 angle_x: 0.0_f32,
17178 angle_y: 0.0_f32,
17179 distance: 0.0_f32,
17180 size_x: 0.0_f32,
17181 size_y: 0.0_f32,
17182 target_num: 0_u8,
17183 frame: MavFrame::DEFAULT,
17184 x: 0.0_f32,
17185 y: 0.0_f32,
17186 z: 0.0_f32,
17187 q: [0.0_f32; 4usize],
17188 mavtype: LandingTargetType::DEFAULT,
17189 position_valid: 0_u8,
17190 };
17191 #[cfg(feature = "arbitrary")]
17192 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17193 use arbitrary::{Arbitrary, Unstructured};
17194 let mut buf = [0u8; 1024];
17195 rng.fill_bytes(&mut buf);
17196 let mut unstructured = Unstructured::new(&buf);
17197 Self::arbitrary(&mut unstructured).unwrap_or_default()
17198 }
17199}
17200impl Default for LANDING_TARGET_DATA {
17201 fn default() -> Self {
17202 Self::DEFAULT.clone()
17203 }
17204}
17205impl MessageData for LANDING_TARGET_DATA {
17206 type Message = MavMessage;
17207 const ID: u32 = 149u32;
17208 const NAME: &'static str = "LANDING_TARGET";
17209 const EXTRA_CRC: u8 = 200u8;
17210 const ENCODED_LEN: usize = 60usize;
17211 fn deser(
17212 _version: MavlinkVersion,
17213 __input: &[u8],
17214 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17215 let avail_len = __input.len();
17216 let mut payload_buf = [0; Self::ENCODED_LEN];
17217 let mut buf = if avail_len < Self::ENCODED_LEN {
17218 payload_buf[0..avail_len].copy_from_slice(__input);
17219 Bytes::new(&payload_buf)
17220 } else {
17221 Bytes::new(__input)
17222 };
17223 let mut __struct = Self::default();
17224 __struct.time_usec = buf.get_u64_le();
17225 __struct.angle_x = buf.get_f32_le();
17226 __struct.angle_y = buf.get_f32_le();
17227 __struct.distance = buf.get_f32_le();
17228 __struct.size_x = buf.get_f32_le();
17229 __struct.size_y = buf.get_f32_le();
17230 __struct.target_num = buf.get_u8();
17231 let tmp = buf.get_u8();
17232 __struct.frame =
17233 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17234 enum_type: "MavFrame",
17235 value: tmp as u64,
17236 })?;
17237 __struct.x = buf.get_f32_le();
17238 __struct.y = buf.get_f32_le();
17239 __struct.z = buf.get_f32_le();
17240 for v in &mut __struct.q {
17241 let val = buf.get_f32_le();
17242 *v = val;
17243 }
17244 let tmp = buf.get_u8();
17245 __struct.mavtype =
17246 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17247 enum_type: "LandingTargetType",
17248 value: tmp as u64,
17249 })?;
17250 __struct.position_valid = buf.get_u8();
17251 Ok(__struct)
17252 }
17253 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17254 let mut __tmp = BytesMut::new(bytes);
17255 #[allow(clippy::absurd_extreme_comparisons)]
17256 #[allow(unused_comparisons)]
17257 if __tmp.remaining() < Self::ENCODED_LEN {
17258 panic!(
17259 "buffer is too small (need {} bytes, but got {})",
17260 Self::ENCODED_LEN,
17261 __tmp.remaining(),
17262 )
17263 }
17264 __tmp.put_u64_le(self.time_usec);
17265 __tmp.put_f32_le(self.angle_x);
17266 __tmp.put_f32_le(self.angle_y);
17267 __tmp.put_f32_le(self.distance);
17268 __tmp.put_f32_le(self.size_x);
17269 __tmp.put_f32_le(self.size_y);
17270 __tmp.put_u8(self.target_num);
17271 __tmp.put_u8(self.frame as u8);
17272 if matches!(version, MavlinkVersion::V2) {
17273 __tmp.put_f32_le(self.x);
17274 __tmp.put_f32_le(self.y);
17275 __tmp.put_f32_le(self.z);
17276 for val in &self.q {
17277 __tmp.put_f32_le(*val);
17278 }
17279 __tmp.put_u8(self.mavtype as u8);
17280 __tmp.put_u8(self.position_valid);
17281 let len = __tmp.len();
17282 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17283 } else {
17284 __tmp.len()
17285 }
17286 }
17287}
17288#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17289#[doc = ""]
17290#[doc = "ID: 8"]
17291#[derive(Debug, Clone, PartialEq)]
17292#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17293#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17294#[cfg_attr(feature = "ts", derive(TS))]
17295#[cfg_attr(feature = "ts", ts(export))]
17296pub struct LINK_NODE_STATUS_DATA {
17297 #[doc = "Timestamp (time since system boot)."]
17298 pub timestamp: u64,
17299 #[doc = "Transmit rate"]
17300 pub tx_rate: u32,
17301 #[doc = "Receive rate"]
17302 pub rx_rate: u32,
17303 #[doc = "Messages sent"]
17304 pub messages_sent: u32,
17305 #[doc = "Messages received (estimated from counting seq)"]
17306 pub messages_received: u32,
17307 #[doc = "Messages lost (estimated from counting seq)"]
17308 pub messages_lost: u32,
17309 #[doc = "Number of bytes that could not be parsed correctly."]
17310 pub rx_parse_err: u16,
17311 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17312 pub tx_overflows: u16,
17313 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17314 pub rx_overflows: u16,
17315 #[doc = "Remaining free transmit buffer space"]
17316 pub tx_buf: u8,
17317 #[doc = "Remaining free receive buffer space"]
17318 pub rx_buf: u8,
17319}
17320impl LINK_NODE_STATUS_DATA {
17321 pub const ENCODED_LEN: usize = 36usize;
17322 pub const DEFAULT: Self = Self {
17323 timestamp: 0_u64,
17324 tx_rate: 0_u32,
17325 rx_rate: 0_u32,
17326 messages_sent: 0_u32,
17327 messages_received: 0_u32,
17328 messages_lost: 0_u32,
17329 rx_parse_err: 0_u16,
17330 tx_overflows: 0_u16,
17331 rx_overflows: 0_u16,
17332 tx_buf: 0_u8,
17333 rx_buf: 0_u8,
17334 };
17335 #[cfg(feature = "arbitrary")]
17336 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17337 use arbitrary::{Arbitrary, Unstructured};
17338 let mut buf = [0u8; 1024];
17339 rng.fill_bytes(&mut buf);
17340 let mut unstructured = Unstructured::new(&buf);
17341 Self::arbitrary(&mut unstructured).unwrap_or_default()
17342 }
17343}
17344impl Default for LINK_NODE_STATUS_DATA {
17345 fn default() -> Self {
17346 Self::DEFAULT.clone()
17347 }
17348}
17349impl MessageData for LINK_NODE_STATUS_DATA {
17350 type Message = MavMessage;
17351 const ID: u32 = 8u32;
17352 const NAME: &'static str = "LINK_NODE_STATUS";
17353 const EXTRA_CRC: u8 = 117u8;
17354 const ENCODED_LEN: usize = 36usize;
17355 fn deser(
17356 _version: MavlinkVersion,
17357 __input: &[u8],
17358 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17359 let avail_len = __input.len();
17360 let mut payload_buf = [0; Self::ENCODED_LEN];
17361 let mut buf = if avail_len < Self::ENCODED_LEN {
17362 payload_buf[0..avail_len].copy_from_slice(__input);
17363 Bytes::new(&payload_buf)
17364 } else {
17365 Bytes::new(__input)
17366 };
17367 let mut __struct = Self::default();
17368 __struct.timestamp = buf.get_u64_le();
17369 __struct.tx_rate = buf.get_u32_le();
17370 __struct.rx_rate = buf.get_u32_le();
17371 __struct.messages_sent = buf.get_u32_le();
17372 __struct.messages_received = buf.get_u32_le();
17373 __struct.messages_lost = buf.get_u32_le();
17374 __struct.rx_parse_err = buf.get_u16_le();
17375 __struct.tx_overflows = buf.get_u16_le();
17376 __struct.rx_overflows = buf.get_u16_le();
17377 __struct.tx_buf = buf.get_u8();
17378 __struct.rx_buf = buf.get_u8();
17379 Ok(__struct)
17380 }
17381 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17382 let mut __tmp = BytesMut::new(bytes);
17383 #[allow(clippy::absurd_extreme_comparisons)]
17384 #[allow(unused_comparisons)]
17385 if __tmp.remaining() < Self::ENCODED_LEN {
17386 panic!(
17387 "buffer is too small (need {} bytes, but got {})",
17388 Self::ENCODED_LEN,
17389 __tmp.remaining(),
17390 )
17391 }
17392 __tmp.put_u64_le(self.timestamp);
17393 __tmp.put_u32_le(self.tx_rate);
17394 __tmp.put_u32_le(self.rx_rate);
17395 __tmp.put_u32_le(self.messages_sent);
17396 __tmp.put_u32_le(self.messages_received);
17397 __tmp.put_u32_le(self.messages_lost);
17398 __tmp.put_u16_le(self.rx_parse_err);
17399 __tmp.put_u16_le(self.tx_overflows);
17400 __tmp.put_u16_le(self.rx_overflows);
17401 __tmp.put_u8(self.tx_buf);
17402 __tmp.put_u8(self.rx_buf);
17403 if matches!(version, MavlinkVersion::V2) {
17404 let len = __tmp.len();
17405 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17406 } else {
17407 __tmp.len()
17408 }
17409 }
17410}
17411#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17412#[doc = ""]
17413#[doc = "ID: 32"]
17414#[derive(Debug, Clone, PartialEq)]
17415#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17416#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17417#[cfg_attr(feature = "ts", derive(TS))]
17418#[cfg_attr(feature = "ts", ts(export))]
17419pub struct LOCAL_POSITION_NED_DATA {
17420 #[doc = "Timestamp (time since system boot)."]
17421 pub time_boot_ms: u32,
17422 #[doc = "X Position"]
17423 pub x: f32,
17424 #[doc = "Y Position"]
17425 pub y: f32,
17426 #[doc = "Z Position"]
17427 pub z: f32,
17428 #[doc = "X Speed"]
17429 pub vx: f32,
17430 #[doc = "Y Speed"]
17431 pub vy: f32,
17432 #[doc = "Z Speed"]
17433 pub vz: f32,
17434}
17435impl LOCAL_POSITION_NED_DATA {
17436 pub const ENCODED_LEN: usize = 28usize;
17437 pub const DEFAULT: Self = Self {
17438 time_boot_ms: 0_u32,
17439 x: 0.0_f32,
17440 y: 0.0_f32,
17441 z: 0.0_f32,
17442 vx: 0.0_f32,
17443 vy: 0.0_f32,
17444 vz: 0.0_f32,
17445 };
17446 #[cfg(feature = "arbitrary")]
17447 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17448 use arbitrary::{Arbitrary, Unstructured};
17449 let mut buf = [0u8; 1024];
17450 rng.fill_bytes(&mut buf);
17451 let mut unstructured = Unstructured::new(&buf);
17452 Self::arbitrary(&mut unstructured).unwrap_or_default()
17453 }
17454}
17455impl Default for LOCAL_POSITION_NED_DATA {
17456 fn default() -> Self {
17457 Self::DEFAULT.clone()
17458 }
17459}
17460impl MessageData for LOCAL_POSITION_NED_DATA {
17461 type Message = MavMessage;
17462 const ID: u32 = 32u32;
17463 const NAME: &'static str = "LOCAL_POSITION_NED";
17464 const EXTRA_CRC: u8 = 185u8;
17465 const ENCODED_LEN: usize = 28usize;
17466 fn deser(
17467 _version: MavlinkVersion,
17468 __input: &[u8],
17469 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17470 let avail_len = __input.len();
17471 let mut payload_buf = [0; Self::ENCODED_LEN];
17472 let mut buf = if avail_len < Self::ENCODED_LEN {
17473 payload_buf[0..avail_len].copy_from_slice(__input);
17474 Bytes::new(&payload_buf)
17475 } else {
17476 Bytes::new(__input)
17477 };
17478 let mut __struct = Self::default();
17479 __struct.time_boot_ms = buf.get_u32_le();
17480 __struct.x = buf.get_f32_le();
17481 __struct.y = buf.get_f32_le();
17482 __struct.z = buf.get_f32_le();
17483 __struct.vx = buf.get_f32_le();
17484 __struct.vy = buf.get_f32_le();
17485 __struct.vz = buf.get_f32_le();
17486 Ok(__struct)
17487 }
17488 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17489 let mut __tmp = BytesMut::new(bytes);
17490 #[allow(clippy::absurd_extreme_comparisons)]
17491 #[allow(unused_comparisons)]
17492 if __tmp.remaining() < Self::ENCODED_LEN {
17493 panic!(
17494 "buffer is too small (need {} bytes, but got {})",
17495 Self::ENCODED_LEN,
17496 __tmp.remaining(),
17497 )
17498 }
17499 __tmp.put_u32_le(self.time_boot_ms);
17500 __tmp.put_f32_le(self.x);
17501 __tmp.put_f32_le(self.y);
17502 __tmp.put_f32_le(self.z);
17503 __tmp.put_f32_le(self.vx);
17504 __tmp.put_f32_le(self.vy);
17505 __tmp.put_f32_le(self.vz);
17506 if matches!(version, MavlinkVersion::V2) {
17507 let len = __tmp.len();
17508 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17509 } else {
17510 __tmp.len()
17511 }
17512 }
17513}
17514#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17515#[doc = ""]
17516#[doc = "ID: 64"]
17517#[derive(Debug, Clone, PartialEq)]
17518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17519#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17520#[cfg_attr(feature = "ts", derive(TS))]
17521#[cfg_attr(feature = "ts", ts(export))]
17522pub struct LOCAL_POSITION_NED_COV_DATA {
17523 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17524 pub time_usec: u64,
17525 #[doc = "X Position"]
17526 pub x: f32,
17527 #[doc = "Y Position"]
17528 pub y: f32,
17529 #[doc = "Z Position"]
17530 pub z: f32,
17531 #[doc = "X Speed"]
17532 pub vx: f32,
17533 #[doc = "Y Speed"]
17534 pub vy: f32,
17535 #[doc = "Z Speed"]
17536 pub vz: f32,
17537 #[doc = "X Acceleration"]
17538 pub ax: f32,
17539 #[doc = "Y Acceleration"]
17540 pub ay: f32,
17541 #[doc = "Z Acceleration"]
17542 pub az: f32,
17543 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17544 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17545 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17546 pub covariance: [f32; 45],
17547 #[doc = "Class id of the estimator this estimate originated from."]
17548 pub estimator_type: MavEstimatorType,
17549}
17550impl LOCAL_POSITION_NED_COV_DATA {
17551 pub const ENCODED_LEN: usize = 225usize;
17552 pub const DEFAULT: Self = Self {
17553 time_usec: 0_u64,
17554 x: 0.0_f32,
17555 y: 0.0_f32,
17556 z: 0.0_f32,
17557 vx: 0.0_f32,
17558 vy: 0.0_f32,
17559 vz: 0.0_f32,
17560 ax: 0.0_f32,
17561 ay: 0.0_f32,
17562 az: 0.0_f32,
17563 covariance: [0.0_f32; 45usize],
17564 estimator_type: MavEstimatorType::DEFAULT,
17565 };
17566 #[cfg(feature = "arbitrary")]
17567 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17568 use arbitrary::{Arbitrary, Unstructured};
17569 let mut buf = [0u8; 1024];
17570 rng.fill_bytes(&mut buf);
17571 let mut unstructured = Unstructured::new(&buf);
17572 Self::arbitrary(&mut unstructured).unwrap_or_default()
17573 }
17574}
17575impl Default for LOCAL_POSITION_NED_COV_DATA {
17576 fn default() -> Self {
17577 Self::DEFAULT.clone()
17578 }
17579}
17580impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17581 type Message = MavMessage;
17582 const ID: u32 = 64u32;
17583 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17584 const EXTRA_CRC: u8 = 191u8;
17585 const ENCODED_LEN: usize = 225usize;
17586 fn deser(
17587 _version: MavlinkVersion,
17588 __input: &[u8],
17589 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17590 let avail_len = __input.len();
17591 let mut payload_buf = [0; Self::ENCODED_LEN];
17592 let mut buf = if avail_len < Self::ENCODED_LEN {
17593 payload_buf[0..avail_len].copy_from_slice(__input);
17594 Bytes::new(&payload_buf)
17595 } else {
17596 Bytes::new(__input)
17597 };
17598 let mut __struct = Self::default();
17599 __struct.time_usec = buf.get_u64_le();
17600 __struct.x = buf.get_f32_le();
17601 __struct.y = buf.get_f32_le();
17602 __struct.z = buf.get_f32_le();
17603 __struct.vx = buf.get_f32_le();
17604 __struct.vy = buf.get_f32_le();
17605 __struct.vz = buf.get_f32_le();
17606 __struct.ax = buf.get_f32_le();
17607 __struct.ay = buf.get_f32_le();
17608 __struct.az = buf.get_f32_le();
17609 for v in &mut __struct.covariance {
17610 let val = buf.get_f32_le();
17611 *v = val;
17612 }
17613 let tmp = buf.get_u8();
17614 __struct.estimator_type =
17615 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17616 enum_type: "MavEstimatorType",
17617 value: tmp as u64,
17618 })?;
17619 Ok(__struct)
17620 }
17621 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17622 let mut __tmp = BytesMut::new(bytes);
17623 #[allow(clippy::absurd_extreme_comparisons)]
17624 #[allow(unused_comparisons)]
17625 if __tmp.remaining() < Self::ENCODED_LEN {
17626 panic!(
17627 "buffer is too small (need {} bytes, but got {})",
17628 Self::ENCODED_LEN,
17629 __tmp.remaining(),
17630 )
17631 }
17632 __tmp.put_u64_le(self.time_usec);
17633 __tmp.put_f32_le(self.x);
17634 __tmp.put_f32_le(self.y);
17635 __tmp.put_f32_le(self.z);
17636 __tmp.put_f32_le(self.vx);
17637 __tmp.put_f32_le(self.vy);
17638 __tmp.put_f32_le(self.vz);
17639 __tmp.put_f32_le(self.ax);
17640 __tmp.put_f32_le(self.ay);
17641 __tmp.put_f32_le(self.az);
17642 for val in &self.covariance {
17643 __tmp.put_f32_le(*val);
17644 }
17645 __tmp.put_u8(self.estimator_type as u8);
17646 if matches!(version, MavlinkVersion::V2) {
17647 let len = __tmp.len();
17648 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17649 } else {
17650 __tmp.len()
17651 }
17652 }
17653}
17654#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17655#[doc = ""]
17656#[doc = "ID: 89"]
17657#[derive(Debug, Clone, PartialEq)]
17658#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17660#[cfg_attr(feature = "ts", derive(TS))]
17661#[cfg_attr(feature = "ts", ts(export))]
17662pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17663 #[doc = "Timestamp (time since system boot)."]
17664 pub time_boot_ms: u32,
17665 #[doc = "X Position"]
17666 pub x: f32,
17667 #[doc = "Y Position"]
17668 pub y: f32,
17669 #[doc = "Z Position"]
17670 pub z: f32,
17671 #[doc = "Roll"]
17672 pub roll: f32,
17673 #[doc = "Pitch"]
17674 pub pitch: f32,
17675 #[doc = "Yaw"]
17676 pub yaw: f32,
17677}
17678impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17679 pub const ENCODED_LEN: usize = 28usize;
17680 pub const DEFAULT: Self = Self {
17681 time_boot_ms: 0_u32,
17682 x: 0.0_f32,
17683 y: 0.0_f32,
17684 z: 0.0_f32,
17685 roll: 0.0_f32,
17686 pitch: 0.0_f32,
17687 yaw: 0.0_f32,
17688 };
17689 #[cfg(feature = "arbitrary")]
17690 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17691 use arbitrary::{Arbitrary, Unstructured};
17692 let mut buf = [0u8; 1024];
17693 rng.fill_bytes(&mut buf);
17694 let mut unstructured = Unstructured::new(&buf);
17695 Self::arbitrary(&mut unstructured).unwrap_or_default()
17696 }
17697}
17698impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17699 fn default() -> Self {
17700 Self::DEFAULT.clone()
17701 }
17702}
17703impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17704 type Message = MavMessage;
17705 const ID: u32 = 89u32;
17706 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17707 const EXTRA_CRC: u8 = 231u8;
17708 const ENCODED_LEN: usize = 28usize;
17709 fn deser(
17710 _version: MavlinkVersion,
17711 __input: &[u8],
17712 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17713 let avail_len = __input.len();
17714 let mut payload_buf = [0; Self::ENCODED_LEN];
17715 let mut buf = if avail_len < Self::ENCODED_LEN {
17716 payload_buf[0..avail_len].copy_from_slice(__input);
17717 Bytes::new(&payload_buf)
17718 } else {
17719 Bytes::new(__input)
17720 };
17721 let mut __struct = Self::default();
17722 __struct.time_boot_ms = buf.get_u32_le();
17723 __struct.x = buf.get_f32_le();
17724 __struct.y = buf.get_f32_le();
17725 __struct.z = buf.get_f32_le();
17726 __struct.roll = buf.get_f32_le();
17727 __struct.pitch = buf.get_f32_le();
17728 __struct.yaw = buf.get_f32_le();
17729 Ok(__struct)
17730 }
17731 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17732 let mut __tmp = BytesMut::new(bytes);
17733 #[allow(clippy::absurd_extreme_comparisons)]
17734 #[allow(unused_comparisons)]
17735 if __tmp.remaining() < Self::ENCODED_LEN {
17736 panic!(
17737 "buffer is too small (need {} bytes, but got {})",
17738 Self::ENCODED_LEN,
17739 __tmp.remaining(),
17740 )
17741 }
17742 __tmp.put_u32_le(self.time_boot_ms);
17743 __tmp.put_f32_le(self.x);
17744 __tmp.put_f32_le(self.y);
17745 __tmp.put_f32_le(self.z);
17746 __tmp.put_f32_le(self.roll);
17747 __tmp.put_f32_le(self.pitch);
17748 __tmp.put_f32_le(self.yaw);
17749 if matches!(version, MavlinkVersion::V2) {
17750 let len = __tmp.len();
17751 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17752 } else {
17753 __tmp.len()
17754 }
17755 }
17756}
17757#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17758#[doc = ""]
17759#[doc = "ID: 268"]
17760#[derive(Debug, Clone, PartialEq)]
17761#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17762#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17763#[cfg_attr(feature = "ts", derive(TS))]
17764#[cfg_attr(feature = "ts", ts(export))]
17765pub struct LOGGING_ACK_DATA {
17766 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17767 pub sequence: u16,
17768 #[doc = "system ID of the target"]
17769 pub target_system: u8,
17770 #[doc = "component ID of the target"]
17771 pub target_component: u8,
17772}
17773impl LOGGING_ACK_DATA {
17774 pub const ENCODED_LEN: usize = 4usize;
17775 pub const DEFAULT: Self = Self {
17776 sequence: 0_u16,
17777 target_system: 0_u8,
17778 target_component: 0_u8,
17779 };
17780 #[cfg(feature = "arbitrary")]
17781 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17782 use arbitrary::{Arbitrary, Unstructured};
17783 let mut buf = [0u8; 1024];
17784 rng.fill_bytes(&mut buf);
17785 let mut unstructured = Unstructured::new(&buf);
17786 Self::arbitrary(&mut unstructured).unwrap_or_default()
17787 }
17788}
17789impl Default for LOGGING_ACK_DATA {
17790 fn default() -> Self {
17791 Self::DEFAULT.clone()
17792 }
17793}
17794impl MessageData for LOGGING_ACK_DATA {
17795 type Message = MavMessage;
17796 const ID: u32 = 268u32;
17797 const NAME: &'static str = "LOGGING_ACK";
17798 const EXTRA_CRC: u8 = 14u8;
17799 const ENCODED_LEN: usize = 4usize;
17800 fn deser(
17801 _version: MavlinkVersion,
17802 __input: &[u8],
17803 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17804 let avail_len = __input.len();
17805 let mut payload_buf = [0; Self::ENCODED_LEN];
17806 let mut buf = if avail_len < Self::ENCODED_LEN {
17807 payload_buf[0..avail_len].copy_from_slice(__input);
17808 Bytes::new(&payload_buf)
17809 } else {
17810 Bytes::new(__input)
17811 };
17812 let mut __struct = Self::default();
17813 __struct.sequence = buf.get_u16_le();
17814 __struct.target_system = buf.get_u8();
17815 __struct.target_component = buf.get_u8();
17816 Ok(__struct)
17817 }
17818 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17819 let mut __tmp = BytesMut::new(bytes);
17820 #[allow(clippy::absurd_extreme_comparisons)]
17821 #[allow(unused_comparisons)]
17822 if __tmp.remaining() < Self::ENCODED_LEN {
17823 panic!(
17824 "buffer is too small (need {} bytes, but got {})",
17825 Self::ENCODED_LEN,
17826 __tmp.remaining(),
17827 )
17828 }
17829 __tmp.put_u16_le(self.sequence);
17830 __tmp.put_u8(self.target_system);
17831 __tmp.put_u8(self.target_component);
17832 if matches!(version, MavlinkVersion::V2) {
17833 let len = __tmp.len();
17834 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17835 } else {
17836 __tmp.len()
17837 }
17838 }
17839}
17840#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
17841#[doc = ""]
17842#[doc = "ID: 266"]
17843#[derive(Debug, Clone, PartialEq)]
17844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17845#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17846#[cfg_attr(feature = "ts", derive(TS))]
17847#[cfg_attr(feature = "ts", ts(export))]
17848pub struct LOGGING_DATA_DATA {
17849 #[doc = "sequence number (can wrap)"]
17850 pub sequence: u16,
17851 #[doc = "system ID of the target"]
17852 pub target_system: u8,
17853 #[doc = "component ID of the target"]
17854 pub target_component: u8,
17855 #[doc = "data length"]
17856 pub length: u8,
17857 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17858 pub first_message_offset: u8,
17859 #[doc = "logged data"]
17860 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17861 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17862 pub data: [u8; 249],
17863}
17864impl LOGGING_DATA_DATA {
17865 pub const ENCODED_LEN: usize = 255usize;
17866 pub const DEFAULT: Self = Self {
17867 sequence: 0_u16,
17868 target_system: 0_u8,
17869 target_component: 0_u8,
17870 length: 0_u8,
17871 first_message_offset: 0_u8,
17872 data: [0_u8; 249usize],
17873 };
17874 #[cfg(feature = "arbitrary")]
17875 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17876 use arbitrary::{Arbitrary, Unstructured};
17877 let mut buf = [0u8; 1024];
17878 rng.fill_bytes(&mut buf);
17879 let mut unstructured = Unstructured::new(&buf);
17880 Self::arbitrary(&mut unstructured).unwrap_or_default()
17881 }
17882}
17883impl Default for LOGGING_DATA_DATA {
17884 fn default() -> Self {
17885 Self::DEFAULT.clone()
17886 }
17887}
17888impl MessageData for LOGGING_DATA_DATA {
17889 type Message = MavMessage;
17890 const ID: u32 = 266u32;
17891 const NAME: &'static str = "LOGGING_DATA";
17892 const EXTRA_CRC: u8 = 193u8;
17893 const ENCODED_LEN: usize = 255usize;
17894 fn deser(
17895 _version: MavlinkVersion,
17896 __input: &[u8],
17897 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17898 let avail_len = __input.len();
17899 let mut payload_buf = [0; Self::ENCODED_LEN];
17900 let mut buf = if avail_len < Self::ENCODED_LEN {
17901 payload_buf[0..avail_len].copy_from_slice(__input);
17902 Bytes::new(&payload_buf)
17903 } else {
17904 Bytes::new(__input)
17905 };
17906 let mut __struct = Self::default();
17907 __struct.sequence = buf.get_u16_le();
17908 __struct.target_system = buf.get_u8();
17909 __struct.target_component = buf.get_u8();
17910 __struct.length = buf.get_u8();
17911 __struct.first_message_offset = buf.get_u8();
17912 for v in &mut __struct.data {
17913 let val = buf.get_u8();
17914 *v = val;
17915 }
17916 Ok(__struct)
17917 }
17918 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17919 let mut __tmp = BytesMut::new(bytes);
17920 #[allow(clippy::absurd_extreme_comparisons)]
17921 #[allow(unused_comparisons)]
17922 if __tmp.remaining() < Self::ENCODED_LEN {
17923 panic!(
17924 "buffer is too small (need {} bytes, but got {})",
17925 Self::ENCODED_LEN,
17926 __tmp.remaining(),
17927 )
17928 }
17929 __tmp.put_u16_le(self.sequence);
17930 __tmp.put_u8(self.target_system);
17931 __tmp.put_u8(self.target_component);
17932 __tmp.put_u8(self.length);
17933 __tmp.put_u8(self.first_message_offset);
17934 for val in &self.data {
17935 __tmp.put_u8(*val);
17936 }
17937 if matches!(version, MavlinkVersion::V2) {
17938 let len = __tmp.len();
17939 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17940 } else {
17941 __tmp.len()
17942 }
17943 }
17944}
17945#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
17946#[doc = ""]
17947#[doc = "ID: 267"]
17948#[derive(Debug, Clone, PartialEq)]
17949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17950#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17951#[cfg_attr(feature = "ts", derive(TS))]
17952#[cfg_attr(feature = "ts", ts(export))]
17953pub struct LOGGING_DATA_ACKED_DATA {
17954 #[doc = "sequence number (can wrap)"]
17955 pub sequence: u16,
17956 #[doc = "system ID of the target"]
17957 pub target_system: u8,
17958 #[doc = "component ID of the target"]
17959 pub target_component: u8,
17960 #[doc = "data length"]
17961 pub length: u8,
17962 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17963 pub first_message_offset: u8,
17964 #[doc = "logged data"]
17965 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17966 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17967 pub data: [u8; 249],
17968}
17969impl LOGGING_DATA_ACKED_DATA {
17970 pub const ENCODED_LEN: usize = 255usize;
17971 pub const DEFAULT: Self = Self {
17972 sequence: 0_u16,
17973 target_system: 0_u8,
17974 target_component: 0_u8,
17975 length: 0_u8,
17976 first_message_offset: 0_u8,
17977 data: [0_u8; 249usize],
17978 };
17979 #[cfg(feature = "arbitrary")]
17980 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17981 use arbitrary::{Arbitrary, Unstructured};
17982 let mut buf = [0u8; 1024];
17983 rng.fill_bytes(&mut buf);
17984 let mut unstructured = Unstructured::new(&buf);
17985 Self::arbitrary(&mut unstructured).unwrap_or_default()
17986 }
17987}
17988impl Default for LOGGING_DATA_ACKED_DATA {
17989 fn default() -> Self {
17990 Self::DEFAULT.clone()
17991 }
17992}
17993impl MessageData for LOGGING_DATA_ACKED_DATA {
17994 type Message = MavMessage;
17995 const ID: u32 = 267u32;
17996 const NAME: &'static str = "LOGGING_DATA_ACKED";
17997 const EXTRA_CRC: u8 = 35u8;
17998 const ENCODED_LEN: usize = 255usize;
17999 fn deser(
18000 _version: MavlinkVersion,
18001 __input: &[u8],
18002 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18003 let avail_len = __input.len();
18004 let mut payload_buf = [0; Self::ENCODED_LEN];
18005 let mut buf = if avail_len < Self::ENCODED_LEN {
18006 payload_buf[0..avail_len].copy_from_slice(__input);
18007 Bytes::new(&payload_buf)
18008 } else {
18009 Bytes::new(__input)
18010 };
18011 let mut __struct = Self::default();
18012 __struct.sequence = buf.get_u16_le();
18013 __struct.target_system = buf.get_u8();
18014 __struct.target_component = buf.get_u8();
18015 __struct.length = buf.get_u8();
18016 __struct.first_message_offset = buf.get_u8();
18017 for v in &mut __struct.data {
18018 let val = buf.get_u8();
18019 *v = val;
18020 }
18021 Ok(__struct)
18022 }
18023 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18024 let mut __tmp = BytesMut::new(bytes);
18025 #[allow(clippy::absurd_extreme_comparisons)]
18026 #[allow(unused_comparisons)]
18027 if __tmp.remaining() < Self::ENCODED_LEN {
18028 panic!(
18029 "buffer is too small (need {} bytes, but got {})",
18030 Self::ENCODED_LEN,
18031 __tmp.remaining(),
18032 )
18033 }
18034 __tmp.put_u16_le(self.sequence);
18035 __tmp.put_u8(self.target_system);
18036 __tmp.put_u8(self.target_component);
18037 __tmp.put_u8(self.length);
18038 __tmp.put_u8(self.first_message_offset);
18039 for val in &self.data {
18040 __tmp.put_u8(*val);
18041 }
18042 if matches!(version, MavlinkVersion::V2) {
18043 let len = __tmp.len();
18044 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18045 } else {
18046 __tmp.len()
18047 }
18048 }
18049}
18050#[doc = "Reply to LOG_REQUEST_DATA."]
18051#[doc = ""]
18052#[doc = "ID: 120"]
18053#[derive(Debug, Clone, PartialEq)]
18054#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18055#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18056#[cfg_attr(feature = "ts", derive(TS))]
18057#[cfg_attr(feature = "ts", ts(export))]
18058pub struct LOG_DATA_DATA {
18059 #[doc = "Offset into the log"]
18060 pub ofs: u32,
18061 #[doc = "Log id (from LOG_ENTRY reply)"]
18062 pub id: u16,
18063 #[doc = "Number of bytes (zero for end of log)"]
18064 pub count: u8,
18065 #[doc = "log data"]
18066 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18067 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18068 pub data: [u8; 90],
18069}
18070impl LOG_DATA_DATA {
18071 pub const ENCODED_LEN: usize = 97usize;
18072 pub const DEFAULT: Self = Self {
18073 ofs: 0_u32,
18074 id: 0_u16,
18075 count: 0_u8,
18076 data: [0_u8; 90usize],
18077 };
18078 #[cfg(feature = "arbitrary")]
18079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18080 use arbitrary::{Arbitrary, Unstructured};
18081 let mut buf = [0u8; 1024];
18082 rng.fill_bytes(&mut buf);
18083 let mut unstructured = Unstructured::new(&buf);
18084 Self::arbitrary(&mut unstructured).unwrap_or_default()
18085 }
18086}
18087impl Default for LOG_DATA_DATA {
18088 fn default() -> Self {
18089 Self::DEFAULT.clone()
18090 }
18091}
18092impl MessageData for LOG_DATA_DATA {
18093 type Message = MavMessage;
18094 const ID: u32 = 120u32;
18095 const NAME: &'static str = "LOG_DATA";
18096 const EXTRA_CRC: u8 = 134u8;
18097 const ENCODED_LEN: usize = 97usize;
18098 fn deser(
18099 _version: MavlinkVersion,
18100 __input: &[u8],
18101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18102 let avail_len = __input.len();
18103 let mut payload_buf = [0; Self::ENCODED_LEN];
18104 let mut buf = if avail_len < Self::ENCODED_LEN {
18105 payload_buf[0..avail_len].copy_from_slice(__input);
18106 Bytes::new(&payload_buf)
18107 } else {
18108 Bytes::new(__input)
18109 };
18110 let mut __struct = Self::default();
18111 __struct.ofs = buf.get_u32_le();
18112 __struct.id = buf.get_u16_le();
18113 __struct.count = buf.get_u8();
18114 for v in &mut __struct.data {
18115 let val = buf.get_u8();
18116 *v = val;
18117 }
18118 Ok(__struct)
18119 }
18120 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18121 let mut __tmp = BytesMut::new(bytes);
18122 #[allow(clippy::absurd_extreme_comparisons)]
18123 #[allow(unused_comparisons)]
18124 if __tmp.remaining() < Self::ENCODED_LEN {
18125 panic!(
18126 "buffer is too small (need {} bytes, but got {})",
18127 Self::ENCODED_LEN,
18128 __tmp.remaining(),
18129 )
18130 }
18131 __tmp.put_u32_le(self.ofs);
18132 __tmp.put_u16_le(self.id);
18133 __tmp.put_u8(self.count);
18134 for val in &self.data {
18135 __tmp.put_u8(*val);
18136 }
18137 if matches!(version, MavlinkVersion::V2) {
18138 let len = __tmp.len();
18139 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18140 } else {
18141 __tmp.len()
18142 }
18143 }
18144}
18145#[doc = "Reply to LOG_REQUEST_LIST."]
18146#[doc = ""]
18147#[doc = "ID: 118"]
18148#[derive(Debug, Clone, PartialEq)]
18149#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18150#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18151#[cfg_attr(feature = "ts", derive(TS))]
18152#[cfg_attr(feature = "ts", ts(export))]
18153pub struct LOG_ENTRY_DATA {
18154 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
18155 pub time_utc: u32,
18156 #[doc = "Size of the log (may be approximate)"]
18157 pub size: u32,
18158 #[doc = "Log id"]
18159 pub id: u16,
18160 #[doc = "Total number of logs"]
18161 pub num_logs: u16,
18162 #[doc = "High log number"]
18163 pub last_log_num: u16,
18164}
18165impl LOG_ENTRY_DATA {
18166 pub const ENCODED_LEN: usize = 14usize;
18167 pub const DEFAULT: Self = Self {
18168 time_utc: 0_u32,
18169 size: 0_u32,
18170 id: 0_u16,
18171 num_logs: 0_u16,
18172 last_log_num: 0_u16,
18173 };
18174 #[cfg(feature = "arbitrary")]
18175 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18176 use arbitrary::{Arbitrary, Unstructured};
18177 let mut buf = [0u8; 1024];
18178 rng.fill_bytes(&mut buf);
18179 let mut unstructured = Unstructured::new(&buf);
18180 Self::arbitrary(&mut unstructured).unwrap_or_default()
18181 }
18182}
18183impl Default for LOG_ENTRY_DATA {
18184 fn default() -> Self {
18185 Self::DEFAULT.clone()
18186 }
18187}
18188impl MessageData for LOG_ENTRY_DATA {
18189 type Message = MavMessage;
18190 const ID: u32 = 118u32;
18191 const NAME: &'static str = "LOG_ENTRY";
18192 const EXTRA_CRC: u8 = 56u8;
18193 const ENCODED_LEN: usize = 14usize;
18194 fn deser(
18195 _version: MavlinkVersion,
18196 __input: &[u8],
18197 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18198 let avail_len = __input.len();
18199 let mut payload_buf = [0; Self::ENCODED_LEN];
18200 let mut buf = if avail_len < Self::ENCODED_LEN {
18201 payload_buf[0..avail_len].copy_from_slice(__input);
18202 Bytes::new(&payload_buf)
18203 } else {
18204 Bytes::new(__input)
18205 };
18206 let mut __struct = Self::default();
18207 __struct.time_utc = buf.get_u32_le();
18208 __struct.size = buf.get_u32_le();
18209 __struct.id = buf.get_u16_le();
18210 __struct.num_logs = buf.get_u16_le();
18211 __struct.last_log_num = buf.get_u16_le();
18212 Ok(__struct)
18213 }
18214 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18215 let mut __tmp = BytesMut::new(bytes);
18216 #[allow(clippy::absurd_extreme_comparisons)]
18217 #[allow(unused_comparisons)]
18218 if __tmp.remaining() < Self::ENCODED_LEN {
18219 panic!(
18220 "buffer is too small (need {} bytes, but got {})",
18221 Self::ENCODED_LEN,
18222 __tmp.remaining(),
18223 )
18224 }
18225 __tmp.put_u32_le(self.time_utc);
18226 __tmp.put_u32_le(self.size);
18227 __tmp.put_u16_le(self.id);
18228 __tmp.put_u16_le(self.num_logs);
18229 __tmp.put_u16_le(self.last_log_num);
18230 if matches!(version, MavlinkVersion::V2) {
18231 let len = __tmp.len();
18232 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18233 } else {
18234 __tmp.len()
18235 }
18236 }
18237}
18238#[doc = "Erase all logs."]
18239#[doc = ""]
18240#[doc = "ID: 121"]
18241#[derive(Debug, Clone, PartialEq)]
18242#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18244#[cfg_attr(feature = "ts", derive(TS))]
18245#[cfg_attr(feature = "ts", ts(export))]
18246pub struct LOG_ERASE_DATA {
18247 #[doc = "System ID"]
18248 pub target_system: u8,
18249 #[doc = "Component ID"]
18250 pub target_component: u8,
18251}
18252impl LOG_ERASE_DATA {
18253 pub const ENCODED_LEN: usize = 2usize;
18254 pub const DEFAULT: Self = Self {
18255 target_system: 0_u8,
18256 target_component: 0_u8,
18257 };
18258 #[cfg(feature = "arbitrary")]
18259 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18260 use arbitrary::{Arbitrary, Unstructured};
18261 let mut buf = [0u8; 1024];
18262 rng.fill_bytes(&mut buf);
18263 let mut unstructured = Unstructured::new(&buf);
18264 Self::arbitrary(&mut unstructured).unwrap_or_default()
18265 }
18266}
18267impl Default for LOG_ERASE_DATA {
18268 fn default() -> Self {
18269 Self::DEFAULT.clone()
18270 }
18271}
18272impl MessageData for LOG_ERASE_DATA {
18273 type Message = MavMessage;
18274 const ID: u32 = 121u32;
18275 const NAME: &'static str = "LOG_ERASE";
18276 const EXTRA_CRC: u8 = 237u8;
18277 const ENCODED_LEN: usize = 2usize;
18278 fn deser(
18279 _version: MavlinkVersion,
18280 __input: &[u8],
18281 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18282 let avail_len = __input.len();
18283 let mut payload_buf = [0; Self::ENCODED_LEN];
18284 let mut buf = if avail_len < Self::ENCODED_LEN {
18285 payload_buf[0..avail_len].copy_from_slice(__input);
18286 Bytes::new(&payload_buf)
18287 } else {
18288 Bytes::new(__input)
18289 };
18290 let mut __struct = Self::default();
18291 __struct.target_system = buf.get_u8();
18292 __struct.target_component = buf.get_u8();
18293 Ok(__struct)
18294 }
18295 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18296 let mut __tmp = BytesMut::new(bytes);
18297 #[allow(clippy::absurd_extreme_comparisons)]
18298 #[allow(unused_comparisons)]
18299 if __tmp.remaining() < Self::ENCODED_LEN {
18300 panic!(
18301 "buffer is too small (need {} bytes, but got {})",
18302 Self::ENCODED_LEN,
18303 __tmp.remaining(),
18304 )
18305 }
18306 __tmp.put_u8(self.target_system);
18307 __tmp.put_u8(self.target_component);
18308 if matches!(version, MavlinkVersion::V2) {
18309 let len = __tmp.len();
18310 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18311 } else {
18312 __tmp.len()
18313 }
18314 }
18315}
18316#[doc = "Request a chunk of a log."]
18317#[doc = ""]
18318#[doc = "ID: 119"]
18319#[derive(Debug, Clone, PartialEq)]
18320#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18321#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18322#[cfg_attr(feature = "ts", derive(TS))]
18323#[cfg_attr(feature = "ts", ts(export))]
18324pub struct LOG_REQUEST_DATA_DATA {
18325 #[doc = "Offset into the log"]
18326 pub ofs: u32,
18327 #[doc = "Number of bytes"]
18328 pub count: u32,
18329 #[doc = "Log id (from LOG_ENTRY reply)"]
18330 pub id: u16,
18331 #[doc = "System ID"]
18332 pub target_system: u8,
18333 #[doc = "Component ID"]
18334 pub target_component: u8,
18335}
18336impl LOG_REQUEST_DATA_DATA {
18337 pub const ENCODED_LEN: usize = 12usize;
18338 pub const DEFAULT: Self = Self {
18339 ofs: 0_u32,
18340 count: 0_u32,
18341 id: 0_u16,
18342 target_system: 0_u8,
18343 target_component: 0_u8,
18344 };
18345 #[cfg(feature = "arbitrary")]
18346 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18347 use arbitrary::{Arbitrary, Unstructured};
18348 let mut buf = [0u8; 1024];
18349 rng.fill_bytes(&mut buf);
18350 let mut unstructured = Unstructured::new(&buf);
18351 Self::arbitrary(&mut unstructured).unwrap_or_default()
18352 }
18353}
18354impl Default for LOG_REQUEST_DATA_DATA {
18355 fn default() -> Self {
18356 Self::DEFAULT.clone()
18357 }
18358}
18359impl MessageData for LOG_REQUEST_DATA_DATA {
18360 type Message = MavMessage;
18361 const ID: u32 = 119u32;
18362 const NAME: &'static str = "LOG_REQUEST_DATA";
18363 const EXTRA_CRC: u8 = 116u8;
18364 const ENCODED_LEN: usize = 12usize;
18365 fn deser(
18366 _version: MavlinkVersion,
18367 __input: &[u8],
18368 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18369 let avail_len = __input.len();
18370 let mut payload_buf = [0; Self::ENCODED_LEN];
18371 let mut buf = if avail_len < Self::ENCODED_LEN {
18372 payload_buf[0..avail_len].copy_from_slice(__input);
18373 Bytes::new(&payload_buf)
18374 } else {
18375 Bytes::new(__input)
18376 };
18377 let mut __struct = Self::default();
18378 __struct.ofs = buf.get_u32_le();
18379 __struct.count = buf.get_u32_le();
18380 __struct.id = buf.get_u16_le();
18381 __struct.target_system = buf.get_u8();
18382 __struct.target_component = buf.get_u8();
18383 Ok(__struct)
18384 }
18385 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18386 let mut __tmp = BytesMut::new(bytes);
18387 #[allow(clippy::absurd_extreme_comparisons)]
18388 #[allow(unused_comparisons)]
18389 if __tmp.remaining() < Self::ENCODED_LEN {
18390 panic!(
18391 "buffer is too small (need {} bytes, but got {})",
18392 Self::ENCODED_LEN,
18393 __tmp.remaining(),
18394 )
18395 }
18396 __tmp.put_u32_le(self.ofs);
18397 __tmp.put_u32_le(self.count);
18398 __tmp.put_u16_le(self.id);
18399 __tmp.put_u8(self.target_system);
18400 __tmp.put_u8(self.target_component);
18401 if matches!(version, MavlinkVersion::V2) {
18402 let len = __tmp.len();
18403 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18404 } else {
18405 __tmp.len()
18406 }
18407 }
18408}
18409#[doc = "Stop log transfer and resume normal logging."]
18410#[doc = ""]
18411#[doc = "ID: 122"]
18412#[derive(Debug, Clone, PartialEq)]
18413#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18414#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18415#[cfg_attr(feature = "ts", derive(TS))]
18416#[cfg_attr(feature = "ts", ts(export))]
18417pub struct LOG_REQUEST_END_DATA {
18418 #[doc = "System ID"]
18419 pub target_system: u8,
18420 #[doc = "Component ID"]
18421 pub target_component: u8,
18422}
18423impl LOG_REQUEST_END_DATA {
18424 pub const ENCODED_LEN: usize = 2usize;
18425 pub const DEFAULT: Self = Self {
18426 target_system: 0_u8,
18427 target_component: 0_u8,
18428 };
18429 #[cfg(feature = "arbitrary")]
18430 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18431 use arbitrary::{Arbitrary, Unstructured};
18432 let mut buf = [0u8; 1024];
18433 rng.fill_bytes(&mut buf);
18434 let mut unstructured = Unstructured::new(&buf);
18435 Self::arbitrary(&mut unstructured).unwrap_or_default()
18436 }
18437}
18438impl Default for LOG_REQUEST_END_DATA {
18439 fn default() -> Self {
18440 Self::DEFAULT.clone()
18441 }
18442}
18443impl MessageData for LOG_REQUEST_END_DATA {
18444 type Message = MavMessage;
18445 const ID: u32 = 122u32;
18446 const NAME: &'static str = "LOG_REQUEST_END";
18447 const EXTRA_CRC: u8 = 203u8;
18448 const ENCODED_LEN: usize = 2usize;
18449 fn deser(
18450 _version: MavlinkVersion,
18451 __input: &[u8],
18452 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18453 let avail_len = __input.len();
18454 let mut payload_buf = [0; Self::ENCODED_LEN];
18455 let mut buf = if avail_len < Self::ENCODED_LEN {
18456 payload_buf[0..avail_len].copy_from_slice(__input);
18457 Bytes::new(&payload_buf)
18458 } else {
18459 Bytes::new(__input)
18460 };
18461 let mut __struct = Self::default();
18462 __struct.target_system = buf.get_u8();
18463 __struct.target_component = buf.get_u8();
18464 Ok(__struct)
18465 }
18466 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18467 let mut __tmp = BytesMut::new(bytes);
18468 #[allow(clippy::absurd_extreme_comparisons)]
18469 #[allow(unused_comparisons)]
18470 if __tmp.remaining() < Self::ENCODED_LEN {
18471 panic!(
18472 "buffer is too small (need {} bytes, but got {})",
18473 Self::ENCODED_LEN,
18474 __tmp.remaining(),
18475 )
18476 }
18477 __tmp.put_u8(self.target_system);
18478 __tmp.put_u8(self.target_component);
18479 if matches!(version, MavlinkVersion::V2) {
18480 let len = __tmp.len();
18481 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18482 } else {
18483 __tmp.len()
18484 }
18485 }
18486}
18487#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18488#[doc = ""]
18489#[doc = "ID: 117"]
18490#[derive(Debug, Clone, PartialEq)]
18491#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18492#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18493#[cfg_attr(feature = "ts", derive(TS))]
18494#[cfg_attr(feature = "ts", ts(export))]
18495pub struct LOG_REQUEST_LIST_DATA {
18496 #[doc = "First log id (0 for first available)"]
18497 pub start: u16,
18498 #[doc = "Last log id (0xffff for last available)"]
18499 pub end: u16,
18500 #[doc = "System ID"]
18501 pub target_system: u8,
18502 #[doc = "Component ID"]
18503 pub target_component: u8,
18504}
18505impl LOG_REQUEST_LIST_DATA {
18506 pub const ENCODED_LEN: usize = 6usize;
18507 pub const DEFAULT: Self = Self {
18508 start: 0_u16,
18509 end: 0_u16,
18510 target_system: 0_u8,
18511 target_component: 0_u8,
18512 };
18513 #[cfg(feature = "arbitrary")]
18514 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18515 use arbitrary::{Arbitrary, Unstructured};
18516 let mut buf = [0u8; 1024];
18517 rng.fill_bytes(&mut buf);
18518 let mut unstructured = Unstructured::new(&buf);
18519 Self::arbitrary(&mut unstructured).unwrap_or_default()
18520 }
18521}
18522impl Default for LOG_REQUEST_LIST_DATA {
18523 fn default() -> Self {
18524 Self::DEFAULT.clone()
18525 }
18526}
18527impl MessageData for LOG_REQUEST_LIST_DATA {
18528 type Message = MavMessage;
18529 const ID: u32 = 117u32;
18530 const NAME: &'static str = "LOG_REQUEST_LIST";
18531 const EXTRA_CRC: u8 = 128u8;
18532 const ENCODED_LEN: usize = 6usize;
18533 fn deser(
18534 _version: MavlinkVersion,
18535 __input: &[u8],
18536 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18537 let avail_len = __input.len();
18538 let mut payload_buf = [0; Self::ENCODED_LEN];
18539 let mut buf = if avail_len < Self::ENCODED_LEN {
18540 payload_buf[0..avail_len].copy_from_slice(__input);
18541 Bytes::new(&payload_buf)
18542 } else {
18543 Bytes::new(__input)
18544 };
18545 let mut __struct = Self::default();
18546 __struct.start = buf.get_u16_le();
18547 __struct.end = buf.get_u16_le();
18548 __struct.target_system = buf.get_u8();
18549 __struct.target_component = buf.get_u8();
18550 Ok(__struct)
18551 }
18552 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18553 let mut __tmp = BytesMut::new(bytes);
18554 #[allow(clippy::absurd_extreme_comparisons)]
18555 #[allow(unused_comparisons)]
18556 if __tmp.remaining() < Self::ENCODED_LEN {
18557 panic!(
18558 "buffer is too small (need {} bytes, but got {})",
18559 Self::ENCODED_LEN,
18560 __tmp.remaining(),
18561 )
18562 }
18563 __tmp.put_u16_le(self.start);
18564 __tmp.put_u16_le(self.end);
18565 __tmp.put_u8(self.target_system);
18566 __tmp.put_u8(self.target_component);
18567 if matches!(version, MavlinkVersion::V2) {
18568 let len = __tmp.len();
18569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18570 } else {
18571 __tmp.len()
18572 }
18573 }
18574}
18575#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18576#[doc = ""]
18577#[doc = "ID: 192"]
18578#[derive(Debug, Clone, PartialEq)]
18579#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18581#[cfg_attr(feature = "ts", derive(TS))]
18582#[cfg_attr(feature = "ts", ts(export))]
18583pub struct MAG_CAL_REPORT_DATA {
18584 #[doc = "RMS milligauss residuals."]
18585 pub fitness: f32,
18586 #[doc = "X offset."]
18587 pub ofs_x: f32,
18588 #[doc = "Y offset."]
18589 pub ofs_y: f32,
18590 #[doc = "Z offset."]
18591 pub ofs_z: f32,
18592 #[doc = "X diagonal (matrix 11)."]
18593 pub diag_x: f32,
18594 #[doc = "Y diagonal (matrix 22)."]
18595 pub diag_y: f32,
18596 #[doc = "Z diagonal (matrix 33)."]
18597 pub diag_z: f32,
18598 #[doc = "X off-diagonal (matrix 12 and 21)."]
18599 pub offdiag_x: f32,
18600 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18601 pub offdiag_y: f32,
18602 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18603 pub offdiag_z: f32,
18604 #[doc = "Compass being calibrated."]
18605 pub compass_id: u8,
18606 #[doc = "Bitmask of compasses being calibrated."]
18607 pub cal_mask: u8,
18608 #[doc = "Calibration Status."]
18609 pub cal_status: MagCalStatus,
18610 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
18611 pub autosaved: u8,
18612 #[doc = "Confidence in orientation (higher is better)."]
18613 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18614 pub orientation_confidence: f32,
18615 #[doc = "orientation before calibration."]
18616 #[cfg_attr(feature = "serde", serde(default))]
18617 pub old_orientation: MavSensorOrientation,
18618 #[doc = "orientation after calibration."]
18619 #[cfg_attr(feature = "serde", serde(default))]
18620 pub new_orientation: MavSensorOrientation,
18621 #[doc = "field radius correction factor"]
18622 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18623 pub scale_factor: f32,
18624}
18625impl MAG_CAL_REPORT_DATA {
18626 pub const ENCODED_LEN: usize = 54usize;
18627 pub const DEFAULT: Self = Self {
18628 fitness: 0.0_f32,
18629 ofs_x: 0.0_f32,
18630 ofs_y: 0.0_f32,
18631 ofs_z: 0.0_f32,
18632 diag_x: 0.0_f32,
18633 diag_y: 0.0_f32,
18634 diag_z: 0.0_f32,
18635 offdiag_x: 0.0_f32,
18636 offdiag_y: 0.0_f32,
18637 offdiag_z: 0.0_f32,
18638 compass_id: 0_u8,
18639 cal_mask: 0_u8,
18640 cal_status: MagCalStatus::DEFAULT,
18641 autosaved: 0_u8,
18642 orientation_confidence: 0.0_f32,
18643 old_orientation: MavSensorOrientation::DEFAULT,
18644 new_orientation: MavSensorOrientation::DEFAULT,
18645 scale_factor: 0.0_f32,
18646 };
18647 #[cfg(feature = "arbitrary")]
18648 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18649 use arbitrary::{Arbitrary, Unstructured};
18650 let mut buf = [0u8; 1024];
18651 rng.fill_bytes(&mut buf);
18652 let mut unstructured = Unstructured::new(&buf);
18653 Self::arbitrary(&mut unstructured).unwrap_or_default()
18654 }
18655}
18656impl Default for MAG_CAL_REPORT_DATA {
18657 fn default() -> Self {
18658 Self::DEFAULT.clone()
18659 }
18660}
18661impl MessageData for MAG_CAL_REPORT_DATA {
18662 type Message = MavMessage;
18663 const ID: u32 = 192u32;
18664 const NAME: &'static str = "MAG_CAL_REPORT";
18665 const EXTRA_CRC: u8 = 36u8;
18666 const ENCODED_LEN: usize = 54usize;
18667 fn deser(
18668 _version: MavlinkVersion,
18669 __input: &[u8],
18670 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18671 let avail_len = __input.len();
18672 let mut payload_buf = [0; Self::ENCODED_LEN];
18673 let mut buf = if avail_len < Self::ENCODED_LEN {
18674 payload_buf[0..avail_len].copy_from_slice(__input);
18675 Bytes::new(&payload_buf)
18676 } else {
18677 Bytes::new(__input)
18678 };
18679 let mut __struct = Self::default();
18680 __struct.fitness = buf.get_f32_le();
18681 __struct.ofs_x = buf.get_f32_le();
18682 __struct.ofs_y = buf.get_f32_le();
18683 __struct.ofs_z = buf.get_f32_le();
18684 __struct.diag_x = buf.get_f32_le();
18685 __struct.diag_y = buf.get_f32_le();
18686 __struct.diag_z = buf.get_f32_le();
18687 __struct.offdiag_x = buf.get_f32_le();
18688 __struct.offdiag_y = buf.get_f32_le();
18689 __struct.offdiag_z = buf.get_f32_le();
18690 __struct.compass_id = buf.get_u8();
18691 __struct.cal_mask = buf.get_u8();
18692 let tmp = buf.get_u8();
18693 __struct.cal_status =
18694 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18695 enum_type: "MagCalStatus",
18696 value: tmp as u64,
18697 })?;
18698 __struct.autosaved = buf.get_u8();
18699 __struct.orientation_confidence = buf.get_f32_le();
18700 let tmp = buf.get_u8();
18701 __struct.old_orientation =
18702 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18703 enum_type: "MavSensorOrientation",
18704 value: tmp as u64,
18705 })?;
18706 let tmp = buf.get_u8();
18707 __struct.new_orientation =
18708 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18709 enum_type: "MavSensorOrientation",
18710 value: tmp as u64,
18711 })?;
18712 __struct.scale_factor = buf.get_f32_le();
18713 Ok(__struct)
18714 }
18715 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18716 let mut __tmp = BytesMut::new(bytes);
18717 #[allow(clippy::absurd_extreme_comparisons)]
18718 #[allow(unused_comparisons)]
18719 if __tmp.remaining() < Self::ENCODED_LEN {
18720 panic!(
18721 "buffer is too small (need {} bytes, but got {})",
18722 Self::ENCODED_LEN,
18723 __tmp.remaining(),
18724 )
18725 }
18726 __tmp.put_f32_le(self.fitness);
18727 __tmp.put_f32_le(self.ofs_x);
18728 __tmp.put_f32_le(self.ofs_y);
18729 __tmp.put_f32_le(self.ofs_z);
18730 __tmp.put_f32_le(self.diag_x);
18731 __tmp.put_f32_le(self.diag_y);
18732 __tmp.put_f32_le(self.diag_z);
18733 __tmp.put_f32_le(self.offdiag_x);
18734 __tmp.put_f32_le(self.offdiag_y);
18735 __tmp.put_f32_le(self.offdiag_z);
18736 __tmp.put_u8(self.compass_id);
18737 __tmp.put_u8(self.cal_mask);
18738 __tmp.put_u8(self.cal_status as u8);
18739 __tmp.put_u8(self.autosaved);
18740 if matches!(version, MavlinkVersion::V2) {
18741 __tmp.put_f32_le(self.orientation_confidence);
18742 __tmp.put_u8(self.old_orientation as u8);
18743 __tmp.put_u8(self.new_orientation as u8);
18744 __tmp.put_f32_le(self.scale_factor);
18745 let len = __tmp.len();
18746 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18747 } else {
18748 __tmp.len()
18749 }
18750 }
18751}
18752#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18753#[doc = ""]
18754#[doc = "ID: 69"]
18755#[derive(Debug, Clone, PartialEq)]
18756#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18757#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18758#[cfg_attr(feature = "ts", derive(TS))]
18759#[cfg_attr(feature = "ts", ts(export))]
18760pub struct MANUAL_CONTROL_DATA {
18761 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18762 pub x: i16,
18763 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18764 pub y: i16,
18765 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18766 pub z: i16,
18767 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18768 pub r: i16,
18769 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18770 pub buttons: u16,
18771 #[doc = "The system to be controlled."]
18772 pub target: u8,
18773 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18774 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18775 pub buttons2: u16,
18776 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18777 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18778 pub enabled_extensions: u8,
18779 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18780 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18781 pub s: i16,
18782 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18783 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18784 pub t: i16,
18785 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18786 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18787 pub aux1: i16,
18788 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18789 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18790 pub aux2: i16,
18791 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18792 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18793 pub aux3: i16,
18794 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18795 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18796 pub aux4: i16,
18797 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18798 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18799 pub aux5: i16,
18800 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18801 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18802 pub aux6: i16,
18803}
18804impl MANUAL_CONTROL_DATA {
18805 pub const ENCODED_LEN: usize = 30usize;
18806 pub const DEFAULT: Self = Self {
18807 x: 0_i16,
18808 y: 0_i16,
18809 z: 0_i16,
18810 r: 0_i16,
18811 buttons: 0_u16,
18812 target: 0_u8,
18813 buttons2: 0_u16,
18814 enabled_extensions: 0_u8,
18815 s: 0_i16,
18816 t: 0_i16,
18817 aux1: 0_i16,
18818 aux2: 0_i16,
18819 aux3: 0_i16,
18820 aux4: 0_i16,
18821 aux5: 0_i16,
18822 aux6: 0_i16,
18823 };
18824 #[cfg(feature = "arbitrary")]
18825 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18826 use arbitrary::{Arbitrary, Unstructured};
18827 let mut buf = [0u8; 1024];
18828 rng.fill_bytes(&mut buf);
18829 let mut unstructured = Unstructured::new(&buf);
18830 Self::arbitrary(&mut unstructured).unwrap_or_default()
18831 }
18832}
18833impl Default for MANUAL_CONTROL_DATA {
18834 fn default() -> Self {
18835 Self::DEFAULT.clone()
18836 }
18837}
18838impl MessageData for MANUAL_CONTROL_DATA {
18839 type Message = MavMessage;
18840 const ID: u32 = 69u32;
18841 const NAME: &'static str = "MANUAL_CONTROL";
18842 const EXTRA_CRC: u8 = 243u8;
18843 const ENCODED_LEN: usize = 30usize;
18844 fn deser(
18845 _version: MavlinkVersion,
18846 __input: &[u8],
18847 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18848 let avail_len = __input.len();
18849 let mut payload_buf = [0; Self::ENCODED_LEN];
18850 let mut buf = if avail_len < Self::ENCODED_LEN {
18851 payload_buf[0..avail_len].copy_from_slice(__input);
18852 Bytes::new(&payload_buf)
18853 } else {
18854 Bytes::new(__input)
18855 };
18856 let mut __struct = Self::default();
18857 __struct.x = buf.get_i16_le();
18858 __struct.y = buf.get_i16_le();
18859 __struct.z = buf.get_i16_le();
18860 __struct.r = buf.get_i16_le();
18861 __struct.buttons = buf.get_u16_le();
18862 __struct.target = buf.get_u8();
18863 __struct.buttons2 = buf.get_u16_le();
18864 __struct.enabled_extensions = buf.get_u8();
18865 __struct.s = buf.get_i16_le();
18866 __struct.t = buf.get_i16_le();
18867 __struct.aux1 = buf.get_i16_le();
18868 __struct.aux2 = buf.get_i16_le();
18869 __struct.aux3 = buf.get_i16_le();
18870 __struct.aux4 = buf.get_i16_le();
18871 __struct.aux5 = buf.get_i16_le();
18872 __struct.aux6 = buf.get_i16_le();
18873 Ok(__struct)
18874 }
18875 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18876 let mut __tmp = BytesMut::new(bytes);
18877 #[allow(clippy::absurd_extreme_comparisons)]
18878 #[allow(unused_comparisons)]
18879 if __tmp.remaining() < Self::ENCODED_LEN {
18880 panic!(
18881 "buffer is too small (need {} bytes, but got {})",
18882 Self::ENCODED_LEN,
18883 __tmp.remaining(),
18884 )
18885 }
18886 __tmp.put_i16_le(self.x);
18887 __tmp.put_i16_le(self.y);
18888 __tmp.put_i16_le(self.z);
18889 __tmp.put_i16_le(self.r);
18890 __tmp.put_u16_le(self.buttons);
18891 __tmp.put_u8(self.target);
18892 if matches!(version, MavlinkVersion::V2) {
18893 __tmp.put_u16_le(self.buttons2);
18894 __tmp.put_u8(self.enabled_extensions);
18895 __tmp.put_i16_le(self.s);
18896 __tmp.put_i16_le(self.t);
18897 __tmp.put_i16_le(self.aux1);
18898 __tmp.put_i16_le(self.aux2);
18899 __tmp.put_i16_le(self.aux3);
18900 __tmp.put_i16_le(self.aux4);
18901 __tmp.put_i16_le(self.aux5);
18902 __tmp.put_i16_le(self.aux6);
18903 let len = __tmp.len();
18904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18905 } else {
18906 __tmp.len()
18907 }
18908 }
18909}
18910#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
18911#[doc = ""]
18912#[doc = "ID: 81"]
18913#[derive(Debug, Clone, PartialEq)]
18914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18916#[cfg_attr(feature = "ts", derive(TS))]
18917#[cfg_attr(feature = "ts", ts(export))]
18918pub struct MANUAL_SETPOINT_DATA {
18919 #[doc = "Timestamp (time since system boot)."]
18920 pub time_boot_ms: u32,
18921 #[doc = "Desired roll rate"]
18922 pub roll: f32,
18923 #[doc = "Desired pitch rate"]
18924 pub pitch: f32,
18925 #[doc = "Desired yaw rate"]
18926 pub yaw: f32,
18927 #[doc = "Collective thrust, normalized to 0 .. 1"]
18928 pub thrust: f32,
18929 #[doc = "Flight mode switch position, 0.. 255"]
18930 pub mode_switch: u8,
18931 #[doc = "Override mode switch position, 0.. 255"]
18932 pub manual_override_switch: u8,
18933}
18934impl MANUAL_SETPOINT_DATA {
18935 pub const ENCODED_LEN: usize = 22usize;
18936 pub const DEFAULT: Self = Self {
18937 time_boot_ms: 0_u32,
18938 roll: 0.0_f32,
18939 pitch: 0.0_f32,
18940 yaw: 0.0_f32,
18941 thrust: 0.0_f32,
18942 mode_switch: 0_u8,
18943 manual_override_switch: 0_u8,
18944 };
18945 #[cfg(feature = "arbitrary")]
18946 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18947 use arbitrary::{Arbitrary, Unstructured};
18948 let mut buf = [0u8; 1024];
18949 rng.fill_bytes(&mut buf);
18950 let mut unstructured = Unstructured::new(&buf);
18951 Self::arbitrary(&mut unstructured).unwrap_or_default()
18952 }
18953}
18954impl Default for MANUAL_SETPOINT_DATA {
18955 fn default() -> Self {
18956 Self::DEFAULT.clone()
18957 }
18958}
18959impl MessageData for MANUAL_SETPOINT_DATA {
18960 type Message = MavMessage;
18961 const ID: u32 = 81u32;
18962 const NAME: &'static str = "MANUAL_SETPOINT";
18963 const EXTRA_CRC: u8 = 106u8;
18964 const ENCODED_LEN: usize = 22usize;
18965 fn deser(
18966 _version: MavlinkVersion,
18967 __input: &[u8],
18968 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18969 let avail_len = __input.len();
18970 let mut payload_buf = [0; Self::ENCODED_LEN];
18971 let mut buf = if avail_len < Self::ENCODED_LEN {
18972 payload_buf[0..avail_len].copy_from_slice(__input);
18973 Bytes::new(&payload_buf)
18974 } else {
18975 Bytes::new(__input)
18976 };
18977 let mut __struct = Self::default();
18978 __struct.time_boot_ms = buf.get_u32_le();
18979 __struct.roll = buf.get_f32_le();
18980 __struct.pitch = buf.get_f32_le();
18981 __struct.yaw = buf.get_f32_le();
18982 __struct.thrust = buf.get_f32_le();
18983 __struct.mode_switch = buf.get_u8();
18984 __struct.manual_override_switch = buf.get_u8();
18985 Ok(__struct)
18986 }
18987 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18988 let mut __tmp = BytesMut::new(bytes);
18989 #[allow(clippy::absurd_extreme_comparisons)]
18990 #[allow(unused_comparisons)]
18991 if __tmp.remaining() < Self::ENCODED_LEN {
18992 panic!(
18993 "buffer is too small (need {} bytes, but got {})",
18994 Self::ENCODED_LEN,
18995 __tmp.remaining(),
18996 )
18997 }
18998 __tmp.put_u32_le(self.time_boot_ms);
18999 __tmp.put_f32_le(self.roll);
19000 __tmp.put_f32_le(self.pitch);
19001 __tmp.put_f32_le(self.yaw);
19002 __tmp.put_f32_le(self.thrust);
19003 __tmp.put_u8(self.mode_switch);
19004 __tmp.put_u8(self.manual_override_switch);
19005 if matches!(version, MavlinkVersion::V2) {
19006 let len = __tmp.len();
19007 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19008 } else {
19009 __tmp.len()
19010 }
19011 }
19012}
19013#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19014#[doc = ""]
19015#[doc = "ID: 249"]
19016#[derive(Debug, Clone, PartialEq)]
19017#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19018#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19019#[cfg_attr(feature = "ts", derive(TS))]
19020#[cfg_attr(feature = "ts", ts(export))]
19021pub struct MEMORY_VECT_DATA {
19022 #[doc = "Starting address of the debug variables"]
19023 pub address: u16,
19024 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
19025 pub ver: u8,
19026 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
19027 pub mavtype: u8,
19028 #[doc = "Memory contents at specified address"]
19029 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19030 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19031 pub value: [i8; 32],
19032}
19033impl MEMORY_VECT_DATA {
19034 pub const ENCODED_LEN: usize = 36usize;
19035 pub const DEFAULT: Self = Self {
19036 address: 0_u16,
19037 ver: 0_u8,
19038 mavtype: 0_u8,
19039 value: [0_i8; 32usize],
19040 };
19041 #[cfg(feature = "arbitrary")]
19042 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19043 use arbitrary::{Arbitrary, Unstructured};
19044 let mut buf = [0u8; 1024];
19045 rng.fill_bytes(&mut buf);
19046 let mut unstructured = Unstructured::new(&buf);
19047 Self::arbitrary(&mut unstructured).unwrap_or_default()
19048 }
19049}
19050impl Default for MEMORY_VECT_DATA {
19051 fn default() -> Self {
19052 Self::DEFAULT.clone()
19053 }
19054}
19055impl MessageData for MEMORY_VECT_DATA {
19056 type Message = MavMessage;
19057 const ID: u32 = 249u32;
19058 const NAME: &'static str = "MEMORY_VECT";
19059 const EXTRA_CRC: u8 = 204u8;
19060 const ENCODED_LEN: usize = 36usize;
19061 fn deser(
19062 _version: MavlinkVersion,
19063 __input: &[u8],
19064 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19065 let avail_len = __input.len();
19066 let mut payload_buf = [0; Self::ENCODED_LEN];
19067 let mut buf = if avail_len < Self::ENCODED_LEN {
19068 payload_buf[0..avail_len].copy_from_slice(__input);
19069 Bytes::new(&payload_buf)
19070 } else {
19071 Bytes::new(__input)
19072 };
19073 let mut __struct = Self::default();
19074 __struct.address = buf.get_u16_le();
19075 __struct.ver = buf.get_u8();
19076 __struct.mavtype = buf.get_u8();
19077 for v in &mut __struct.value {
19078 let val = buf.get_i8();
19079 *v = val;
19080 }
19081 Ok(__struct)
19082 }
19083 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19084 let mut __tmp = BytesMut::new(bytes);
19085 #[allow(clippy::absurd_extreme_comparisons)]
19086 #[allow(unused_comparisons)]
19087 if __tmp.remaining() < Self::ENCODED_LEN {
19088 panic!(
19089 "buffer is too small (need {} bytes, but got {})",
19090 Self::ENCODED_LEN,
19091 __tmp.remaining(),
19092 )
19093 }
19094 __tmp.put_u16_le(self.address);
19095 __tmp.put_u8(self.ver);
19096 __tmp.put_u8(self.mavtype);
19097 for val in &self.value {
19098 __tmp.put_i8(*val);
19099 }
19100 if matches!(version, MavlinkVersion::V2) {
19101 let len = __tmp.len();
19102 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19103 } else {
19104 __tmp.len()
19105 }
19106 }
19107}
19108#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
19109#[doc = ""]
19110#[doc = "ID: 244"]
19111#[derive(Debug, Clone, PartialEq)]
19112#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19113#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19114#[cfg_attr(feature = "ts", derive(TS))]
19115#[cfg_attr(feature = "ts", ts(export))]
19116pub struct MESSAGE_INTERVAL_DATA {
19117 #[doc = "0 indicates the interval at which it is sent."]
19118 pub interval_us: i32,
19119 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
19120 pub message_id: u16,
19121}
19122impl MESSAGE_INTERVAL_DATA {
19123 pub const ENCODED_LEN: usize = 6usize;
19124 pub const DEFAULT: Self = Self {
19125 interval_us: 0_i32,
19126 message_id: 0_u16,
19127 };
19128 #[cfg(feature = "arbitrary")]
19129 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19130 use arbitrary::{Arbitrary, Unstructured};
19131 let mut buf = [0u8; 1024];
19132 rng.fill_bytes(&mut buf);
19133 let mut unstructured = Unstructured::new(&buf);
19134 Self::arbitrary(&mut unstructured).unwrap_or_default()
19135 }
19136}
19137impl Default for MESSAGE_INTERVAL_DATA {
19138 fn default() -> Self {
19139 Self::DEFAULT.clone()
19140 }
19141}
19142impl MessageData for MESSAGE_INTERVAL_DATA {
19143 type Message = MavMessage;
19144 const ID: u32 = 244u32;
19145 const NAME: &'static str = "MESSAGE_INTERVAL";
19146 const EXTRA_CRC: u8 = 95u8;
19147 const ENCODED_LEN: usize = 6usize;
19148 fn deser(
19149 _version: MavlinkVersion,
19150 __input: &[u8],
19151 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19152 let avail_len = __input.len();
19153 let mut payload_buf = [0; Self::ENCODED_LEN];
19154 let mut buf = if avail_len < Self::ENCODED_LEN {
19155 payload_buf[0..avail_len].copy_from_slice(__input);
19156 Bytes::new(&payload_buf)
19157 } else {
19158 Bytes::new(__input)
19159 };
19160 let mut __struct = Self::default();
19161 __struct.interval_us = buf.get_i32_le();
19162 __struct.message_id = buf.get_u16_le();
19163 Ok(__struct)
19164 }
19165 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19166 let mut __tmp = BytesMut::new(bytes);
19167 #[allow(clippy::absurd_extreme_comparisons)]
19168 #[allow(unused_comparisons)]
19169 if __tmp.remaining() < Self::ENCODED_LEN {
19170 panic!(
19171 "buffer is too small (need {} bytes, but got {})",
19172 Self::ENCODED_LEN,
19173 __tmp.remaining(),
19174 )
19175 }
19176 __tmp.put_i32_le(self.interval_us);
19177 __tmp.put_u16_le(self.message_id);
19178 if matches!(version, MavlinkVersion::V2) {
19179 let len = __tmp.len();
19180 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19181 } else {
19182 __tmp.len()
19183 }
19184 }
19185}
19186#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
19187#[doc = ""]
19188#[doc = "ID: 47"]
19189#[derive(Debug, Clone, PartialEq)]
19190#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19191#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19192#[cfg_attr(feature = "ts", derive(TS))]
19193#[cfg_attr(feature = "ts", ts(export))]
19194pub struct MISSION_ACK_DATA {
19195 #[doc = "System ID"]
19196 pub target_system: u8,
19197 #[doc = "Component ID"]
19198 pub target_component: u8,
19199 #[doc = "Mission result."]
19200 pub mavtype: MavMissionResult,
19201 #[doc = "Mission type."]
19202 #[cfg_attr(feature = "serde", serde(default))]
19203 pub mission_type: MavMissionType,
19204 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
19205 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19206 pub opaque_id: u32,
19207}
19208impl MISSION_ACK_DATA {
19209 pub const ENCODED_LEN: usize = 8usize;
19210 pub const DEFAULT: Self = Self {
19211 target_system: 0_u8,
19212 target_component: 0_u8,
19213 mavtype: MavMissionResult::DEFAULT,
19214 mission_type: MavMissionType::DEFAULT,
19215 opaque_id: 0_u32,
19216 };
19217 #[cfg(feature = "arbitrary")]
19218 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19219 use arbitrary::{Arbitrary, Unstructured};
19220 let mut buf = [0u8; 1024];
19221 rng.fill_bytes(&mut buf);
19222 let mut unstructured = Unstructured::new(&buf);
19223 Self::arbitrary(&mut unstructured).unwrap_or_default()
19224 }
19225}
19226impl Default for MISSION_ACK_DATA {
19227 fn default() -> Self {
19228 Self::DEFAULT.clone()
19229 }
19230}
19231impl MessageData for MISSION_ACK_DATA {
19232 type Message = MavMessage;
19233 const ID: u32 = 47u32;
19234 const NAME: &'static str = "MISSION_ACK";
19235 const EXTRA_CRC: u8 = 153u8;
19236 const ENCODED_LEN: usize = 8usize;
19237 fn deser(
19238 _version: MavlinkVersion,
19239 __input: &[u8],
19240 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19241 let avail_len = __input.len();
19242 let mut payload_buf = [0; Self::ENCODED_LEN];
19243 let mut buf = if avail_len < Self::ENCODED_LEN {
19244 payload_buf[0..avail_len].copy_from_slice(__input);
19245 Bytes::new(&payload_buf)
19246 } else {
19247 Bytes::new(__input)
19248 };
19249 let mut __struct = Self::default();
19250 __struct.target_system = buf.get_u8();
19251 __struct.target_component = buf.get_u8();
19252 let tmp = buf.get_u8();
19253 __struct.mavtype =
19254 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19255 enum_type: "MavMissionResult",
19256 value: tmp as u64,
19257 })?;
19258 let tmp = buf.get_u8();
19259 __struct.mission_type =
19260 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19261 enum_type: "MavMissionType",
19262 value: tmp as u64,
19263 })?;
19264 __struct.opaque_id = buf.get_u32_le();
19265 Ok(__struct)
19266 }
19267 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19268 let mut __tmp = BytesMut::new(bytes);
19269 #[allow(clippy::absurd_extreme_comparisons)]
19270 #[allow(unused_comparisons)]
19271 if __tmp.remaining() < Self::ENCODED_LEN {
19272 panic!(
19273 "buffer is too small (need {} bytes, but got {})",
19274 Self::ENCODED_LEN,
19275 __tmp.remaining(),
19276 )
19277 }
19278 __tmp.put_u8(self.target_system);
19279 __tmp.put_u8(self.target_component);
19280 __tmp.put_u8(self.mavtype as u8);
19281 if matches!(version, MavlinkVersion::V2) {
19282 __tmp.put_u8(self.mission_type as u8);
19283 __tmp.put_u32_le(self.opaque_id);
19284 let len = __tmp.len();
19285 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19286 } else {
19287 __tmp.len()
19288 }
19289 }
19290}
19291#[doc = "Delete all mission items at once."]
19292#[doc = ""]
19293#[doc = "ID: 45"]
19294#[derive(Debug, Clone, PartialEq)]
19295#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19296#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19297#[cfg_attr(feature = "ts", derive(TS))]
19298#[cfg_attr(feature = "ts", ts(export))]
19299pub struct MISSION_CLEAR_ALL_DATA {
19300 #[doc = "System ID"]
19301 pub target_system: u8,
19302 #[doc = "Component ID"]
19303 pub target_component: u8,
19304 #[doc = "Mission type."]
19305 #[cfg_attr(feature = "serde", serde(default))]
19306 pub mission_type: MavMissionType,
19307}
19308impl MISSION_CLEAR_ALL_DATA {
19309 pub const ENCODED_LEN: usize = 3usize;
19310 pub const DEFAULT: Self = Self {
19311 target_system: 0_u8,
19312 target_component: 0_u8,
19313 mission_type: MavMissionType::DEFAULT,
19314 };
19315 #[cfg(feature = "arbitrary")]
19316 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19317 use arbitrary::{Arbitrary, Unstructured};
19318 let mut buf = [0u8; 1024];
19319 rng.fill_bytes(&mut buf);
19320 let mut unstructured = Unstructured::new(&buf);
19321 Self::arbitrary(&mut unstructured).unwrap_or_default()
19322 }
19323}
19324impl Default for MISSION_CLEAR_ALL_DATA {
19325 fn default() -> Self {
19326 Self::DEFAULT.clone()
19327 }
19328}
19329impl MessageData for MISSION_CLEAR_ALL_DATA {
19330 type Message = MavMessage;
19331 const ID: u32 = 45u32;
19332 const NAME: &'static str = "MISSION_CLEAR_ALL";
19333 const EXTRA_CRC: u8 = 232u8;
19334 const ENCODED_LEN: usize = 3usize;
19335 fn deser(
19336 _version: MavlinkVersion,
19337 __input: &[u8],
19338 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19339 let avail_len = __input.len();
19340 let mut payload_buf = [0; Self::ENCODED_LEN];
19341 let mut buf = if avail_len < Self::ENCODED_LEN {
19342 payload_buf[0..avail_len].copy_from_slice(__input);
19343 Bytes::new(&payload_buf)
19344 } else {
19345 Bytes::new(__input)
19346 };
19347 let mut __struct = Self::default();
19348 __struct.target_system = buf.get_u8();
19349 __struct.target_component = buf.get_u8();
19350 let tmp = buf.get_u8();
19351 __struct.mission_type =
19352 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19353 enum_type: "MavMissionType",
19354 value: tmp as u64,
19355 })?;
19356 Ok(__struct)
19357 }
19358 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19359 let mut __tmp = BytesMut::new(bytes);
19360 #[allow(clippy::absurd_extreme_comparisons)]
19361 #[allow(unused_comparisons)]
19362 if __tmp.remaining() < Self::ENCODED_LEN {
19363 panic!(
19364 "buffer is too small (need {} bytes, but got {})",
19365 Self::ENCODED_LEN,
19366 __tmp.remaining(),
19367 )
19368 }
19369 __tmp.put_u8(self.target_system);
19370 __tmp.put_u8(self.target_component);
19371 if matches!(version, MavlinkVersion::V2) {
19372 __tmp.put_u8(self.mission_type as u8);
19373 let len = __tmp.len();
19374 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19375 } else {
19376 __tmp.len()
19377 }
19378 }
19379}
19380#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19381#[doc = ""]
19382#[doc = "ID: 44"]
19383#[derive(Debug, Clone, PartialEq)]
19384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19385#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19386#[cfg_attr(feature = "ts", derive(TS))]
19387#[cfg_attr(feature = "ts", ts(export))]
19388pub struct MISSION_COUNT_DATA {
19389 #[doc = "Number of mission items in the sequence"]
19390 pub count: u16,
19391 #[doc = "System ID"]
19392 pub target_system: u8,
19393 #[doc = "Component ID"]
19394 pub target_component: u8,
19395 #[doc = "Mission type."]
19396 #[cfg_attr(feature = "serde", serde(default))]
19397 pub mission_type: MavMissionType,
19398 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
19399 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19400 pub opaque_id: u32,
19401}
19402impl MISSION_COUNT_DATA {
19403 pub const ENCODED_LEN: usize = 9usize;
19404 pub const DEFAULT: Self = Self {
19405 count: 0_u16,
19406 target_system: 0_u8,
19407 target_component: 0_u8,
19408 mission_type: MavMissionType::DEFAULT,
19409 opaque_id: 0_u32,
19410 };
19411 #[cfg(feature = "arbitrary")]
19412 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19413 use arbitrary::{Arbitrary, Unstructured};
19414 let mut buf = [0u8; 1024];
19415 rng.fill_bytes(&mut buf);
19416 let mut unstructured = Unstructured::new(&buf);
19417 Self::arbitrary(&mut unstructured).unwrap_or_default()
19418 }
19419}
19420impl Default for MISSION_COUNT_DATA {
19421 fn default() -> Self {
19422 Self::DEFAULT.clone()
19423 }
19424}
19425impl MessageData for MISSION_COUNT_DATA {
19426 type Message = MavMessage;
19427 const ID: u32 = 44u32;
19428 const NAME: &'static str = "MISSION_COUNT";
19429 const EXTRA_CRC: u8 = 221u8;
19430 const ENCODED_LEN: usize = 9usize;
19431 fn deser(
19432 _version: MavlinkVersion,
19433 __input: &[u8],
19434 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19435 let avail_len = __input.len();
19436 let mut payload_buf = [0; Self::ENCODED_LEN];
19437 let mut buf = if avail_len < Self::ENCODED_LEN {
19438 payload_buf[0..avail_len].copy_from_slice(__input);
19439 Bytes::new(&payload_buf)
19440 } else {
19441 Bytes::new(__input)
19442 };
19443 let mut __struct = Self::default();
19444 __struct.count = buf.get_u16_le();
19445 __struct.target_system = buf.get_u8();
19446 __struct.target_component = buf.get_u8();
19447 let tmp = buf.get_u8();
19448 __struct.mission_type =
19449 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19450 enum_type: "MavMissionType",
19451 value: tmp as u64,
19452 })?;
19453 __struct.opaque_id = buf.get_u32_le();
19454 Ok(__struct)
19455 }
19456 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19457 let mut __tmp = BytesMut::new(bytes);
19458 #[allow(clippy::absurd_extreme_comparisons)]
19459 #[allow(unused_comparisons)]
19460 if __tmp.remaining() < Self::ENCODED_LEN {
19461 panic!(
19462 "buffer is too small (need {} bytes, but got {})",
19463 Self::ENCODED_LEN,
19464 __tmp.remaining(),
19465 )
19466 }
19467 __tmp.put_u16_le(self.count);
19468 __tmp.put_u8(self.target_system);
19469 __tmp.put_u8(self.target_component);
19470 if matches!(version, MavlinkVersion::V2) {
19471 __tmp.put_u8(self.mission_type as u8);
19472 __tmp.put_u32_le(self.opaque_id);
19473 let len = __tmp.len();
19474 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19475 } else {
19476 __tmp.len()
19477 }
19478 }
19479}
19480#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19481#[doc = ""]
19482#[doc = "ID: 42"]
19483#[derive(Debug, Clone, PartialEq)]
19484#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19485#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19486#[cfg_attr(feature = "ts", derive(TS))]
19487#[cfg_attr(feature = "ts", ts(export))]
19488pub struct MISSION_CURRENT_DATA {
19489 #[doc = "Sequence"]
19490 pub seq: u16,
19491 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19492 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19493 pub total: u16,
19494 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19495 #[cfg_attr(feature = "serde", serde(default))]
19496 pub mission_state: MissionState,
19497 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19498 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19499 pub mission_mode: u8,
19500 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19501 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19502 pub mission_id: u32,
19503 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19504 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19505 pub fence_id: u32,
19506 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19507 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19508 pub rally_points_id: u32,
19509}
19510impl MISSION_CURRENT_DATA {
19511 pub const ENCODED_LEN: usize = 18usize;
19512 pub const DEFAULT: Self = Self {
19513 seq: 0_u16,
19514 total: 0_u16,
19515 mission_state: MissionState::DEFAULT,
19516 mission_mode: 0_u8,
19517 mission_id: 0_u32,
19518 fence_id: 0_u32,
19519 rally_points_id: 0_u32,
19520 };
19521 #[cfg(feature = "arbitrary")]
19522 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19523 use arbitrary::{Arbitrary, Unstructured};
19524 let mut buf = [0u8; 1024];
19525 rng.fill_bytes(&mut buf);
19526 let mut unstructured = Unstructured::new(&buf);
19527 Self::arbitrary(&mut unstructured).unwrap_or_default()
19528 }
19529}
19530impl Default for MISSION_CURRENT_DATA {
19531 fn default() -> Self {
19532 Self::DEFAULT.clone()
19533 }
19534}
19535impl MessageData for MISSION_CURRENT_DATA {
19536 type Message = MavMessage;
19537 const ID: u32 = 42u32;
19538 const NAME: &'static str = "MISSION_CURRENT";
19539 const EXTRA_CRC: u8 = 28u8;
19540 const ENCODED_LEN: usize = 18usize;
19541 fn deser(
19542 _version: MavlinkVersion,
19543 __input: &[u8],
19544 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19545 let avail_len = __input.len();
19546 let mut payload_buf = [0; Self::ENCODED_LEN];
19547 let mut buf = if avail_len < Self::ENCODED_LEN {
19548 payload_buf[0..avail_len].copy_from_slice(__input);
19549 Bytes::new(&payload_buf)
19550 } else {
19551 Bytes::new(__input)
19552 };
19553 let mut __struct = Self::default();
19554 __struct.seq = buf.get_u16_le();
19555 __struct.total = buf.get_u16_le();
19556 let tmp = buf.get_u8();
19557 __struct.mission_state =
19558 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19559 enum_type: "MissionState",
19560 value: tmp as u64,
19561 })?;
19562 __struct.mission_mode = buf.get_u8();
19563 __struct.mission_id = buf.get_u32_le();
19564 __struct.fence_id = buf.get_u32_le();
19565 __struct.rally_points_id = buf.get_u32_le();
19566 Ok(__struct)
19567 }
19568 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19569 let mut __tmp = BytesMut::new(bytes);
19570 #[allow(clippy::absurd_extreme_comparisons)]
19571 #[allow(unused_comparisons)]
19572 if __tmp.remaining() < Self::ENCODED_LEN {
19573 panic!(
19574 "buffer is too small (need {} bytes, but got {})",
19575 Self::ENCODED_LEN,
19576 __tmp.remaining(),
19577 )
19578 }
19579 __tmp.put_u16_le(self.seq);
19580 if matches!(version, MavlinkVersion::V2) {
19581 __tmp.put_u16_le(self.total);
19582 __tmp.put_u8(self.mission_state as u8);
19583 __tmp.put_u8(self.mission_mode);
19584 __tmp.put_u32_le(self.mission_id);
19585 __tmp.put_u32_le(self.fence_id);
19586 __tmp.put_u32_le(self.rally_points_id);
19587 let len = __tmp.len();
19588 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19589 } else {
19590 __tmp.len()
19591 }
19592 }
19593}
19594#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
19595#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19596#[doc = ""]
19597#[doc = "ID: 39"]
19598#[derive(Debug, Clone, PartialEq)]
19599#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19600#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19601#[cfg_attr(feature = "ts", derive(TS))]
19602#[cfg_attr(feature = "ts", ts(export))]
19603pub struct MISSION_ITEM_DATA {
19604 #[doc = "PARAM1, see MAV_CMD enum"]
19605 pub param1: f32,
19606 #[doc = "PARAM2, see MAV_CMD enum"]
19607 pub param2: f32,
19608 #[doc = "PARAM3, see MAV_CMD enum"]
19609 pub param3: f32,
19610 #[doc = "PARAM4, see MAV_CMD enum"]
19611 pub param4: f32,
19612 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
19613 pub x: f32,
19614 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
19615 pub y: f32,
19616 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
19617 pub z: f32,
19618 #[doc = "Sequence"]
19619 pub seq: u16,
19620 #[doc = "The scheduled action for the waypoint."]
19621 pub command: MavCmd,
19622 #[doc = "System ID"]
19623 pub target_system: u8,
19624 #[doc = "Component ID"]
19625 pub target_component: u8,
19626 #[doc = "The coordinate system of the waypoint."]
19627 pub frame: MavFrame,
19628 #[doc = "false:0, true:1"]
19629 pub current: u8,
19630 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19631 pub autocontinue: u8,
19632 #[doc = "Mission type."]
19633 #[cfg_attr(feature = "serde", serde(default))]
19634 pub mission_type: MavMissionType,
19635}
19636impl MISSION_ITEM_DATA {
19637 pub const ENCODED_LEN: usize = 38usize;
19638 pub const DEFAULT: Self = Self {
19639 param1: 0.0_f32,
19640 param2: 0.0_f32,
19641 param3: 0.0_f32,
19642 param4: 0.0_f32,
19643 x: 0.0_f32,
19644 y: 0.0_f32,
19645 z: 0.0_f32,
19646 seq: 0_u16,
19647 command: MavCmd::DEFAULT,
19648 target_system: 0_u8,
19649 target_component: 0_u8,
19650 frame: MavFrame::DEFAULT,
19651 current: 0_u8,
19652 autocontinue: 0_u8,
19653 mission_type: MavMissionType::DEFAULT,
19654 };
19655 #[cfg(feature = "arbitrary")]
19656 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19657 use arbitrary::{Arbitrary, Unstructured};
19658 let mut buf = [0u8; 1024];
19659 rng.fill_bytes(&mut buf);
19660 let mut unstructured = Unstructured::new(&buf);
19661 Self::arbitrary(&mut unstructured).unwrap_or_default()
19662 }
19663}
19664impl Default for MISSION_ITEM_DATA {
19665 fn default() -> Self {
19666 Self::DEFAULT.clone()
19667 }
19668}
19669impl MessageData for MISSION_ITEM_DATA {
19670 type Message = MavMessage;
19671 const ID: u32 = 39u32;
19672 const NAME: &'static str = "MISSION_ITEM";
19673 const EXTRA_CRC: u8 = 254u8;
19674 const ENCODED_LEN: usize = 38usize;
19675 fn deser(
19676 _version: MavlinkVersion,
19677 __input: &[u8],
19678 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19679 let avail_len = __input.len();
19680 let mut payload_buf = [0; Self::ENCODED_LEN];
19681 let mut buf = if avail_len < Self::ENCODED_LEN {
19682 payload_buf[0..avail_len].copy_from_slice(__input);
19683 Bytes::new(&payload_buf)
19684 } else {
19685 Bytes::new(__input)
19686 };
19687 let mut __struct = Self::default();
19688 __struct.param1 = buf.get_f32_le();
19689 __struct.param2 = buf.get_f32_le();
19690 __struct.param3 = buf.get_f32_le();
19691 __struct.param4 = buf.get_f32_le();
19692 __struct.x = buf.get_f32_le();
19693 __struct.y = buf.get_f32_le();
19694 __struct.z = buf.get_f32_le();
19695 __struct.seq = buf.get_u16_le();
19696 let tmp = buf.get_u16_le();
19697 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19698 ::mavlink_core::error::ParserError::InvalidEnum {
19699 enum_type: "MavCmd",
19700 value: tmp as u64,
19701 },
19702 )?;
19703 __struct.target_system = buf.get_u8();
19704 __struct.target_component = buf.get_u8();
19705 let tmp = buf.get_u8();
19706 __struct.frame =
19707 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19708 enum_type: "MavFrame",
19709 value: tmp as u64,
19710 })?;
19711 __struct.current = buf.get_u8();
19712 __struct.autocontinue = buf.get_u8();
19713 let tmp = buf.get_u8();
19714 __struct.mission_type =
19715 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19716 enum_type: "MavMissionType",
19717 value: tmp as u64,
19718 })?;
19719 Ok(__struct)
19720 }
19721 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19722 let mut __tmp = BytesMut::new(bytes);
19723 #[allow(clippy::absurd_extreme_comparisons)]
19724 #[allow(unused_comparisons)]
19725 if __tmp.remaining() < Self::ENCODED_LEN {
19726 panic!(
19727 "buffer is too small (need {} bytes, but got {})",
19728 Self::ENCODED_LEN,
19729 __tmp.remaining(),
19730 )
19731 }
19732 __tmp.put_f32_le(self.param1);
19733 __tmp.put_f32_le(self.param2);
19734 __tmp.put_f32_le(self.param3);
19735 __tmp.put_f32_le(self.param4);
19736 __tmp.put_f32_le(self.x);
19737 __tmp.put_f32_le(self.y);
19738 __tmp.put_f32_le(self.z);
19739 __tmp.put_u16_le(self.seq);
19740 __tmp.put_u16_le(self.command as u16);
19741 __tmp.put_u8(self.target_system);
19742 __tmp.put_u8(self.target_component);
19743 __tmp.put_u8(self.frame as u8);
19744 __tmp.put_u8(self.current);
19745 __tmp.put_u8(self.autocontinue);
19746 if matches!(version, MavlinkVersion::V2) {
19747 __tmp.put_u8(self.mission_type as u8);
19748 let len = __tmp.len();
19749 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19750 } else {
19751 __tmp.len()
19752 }
19753 }
19754}
19755#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19756#[doc = ""]
19757#[doc = "ID: 73"]
19758#[derive(Debug, Clone, PartialEq)]
19759#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19761#[cfg_attr(feature = "ts", derive(TS))]
19762#[cfg_attr(feature = "ts", ts(export))]
19763pub struct MISSION_ITEM_INT_DATA {
19764 #[doc = "PARAM1, see MAV_CMD enum"]
19765 pub param1: f32,
19766 #[doc = "PARAM2, see MAV_CMD enum"]
19767 pub param2: f32,
19768 #[doc = "PARAM3, see MAV_CMD enum"]
19769 pub param3: f32,
19770 #[doc = "PARAM4, see MAV_CMD enum"]
19771 pub param4: f32,
19772 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
19773 pub x: i32,
19774 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19775 pub y: i32,
19776 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19777 pub z: f32,
19778 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19779 pub seq: u16,
19780 #[doc = "The scheduled action for the waypoint."]
19781 pub command: MavCmd,
19782 #[doc = "System ID"]
19783 pub target_system: u8,
19784 #[doc = "Component ID"]
19785 pub target_component: u8,
19786 #[doc = "The coordinate system of the waypoint."]
19787 pub frame: MavFrame,
19788 #[doc = "false:0, true:1"]
19789 pub current: u8,
19790 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19791 pub autocontinue: u8,
19792 #[doc = "Mission type."]
19793 #[cfg_attr(feature = "serde", serde(default))]
19794 pub mission_type: MavMissionType,
19795}
19796impl MISSION_ITEM_INT_DATA {
19797 pub const ENCODED_LEN: usize = 38usize;
19798 pub const DEFAULT: Self = Self {
19799 param1: 0.0_f32,
19800 param2: 0.0_f32,
19801 param3: 0.0_f32,
19802 param4: 0.0_f32,
19803 x: 0_i32,
19804 y: 0_i32,
19805 z: 0.0_f32,
19806 seq: 0_u16,
19807 command: MavCmd::DEFAULT,
19808 target_system: 0_u8,
19809 target_component: 0_u8,
19810 frame: MavFrame::DEFAULT,
19811 current: 0_u8,
19812 autocontinue: 0_u8,
19813 mission_type: MavMissionType::DEFAULT,
19814 };
19815 #[cfg(feature = "arbitrary")]
19816 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19817 use arbitrary::{Arbitrary, Unstructured};
19818 let mut buf = [0u8; 1024];
19819 rng.fill_bytes(&mut buf);
19820 let mut unstructured = Unstructured::new(&buf);
19821 Self::arbitrary(&mut unstructured).unwrap_or_default()
19822 }
19823}
19824impl Default for MISSION_ITEM_INT_DATA {
19825 fn default() -> Self {
19826 Self::DEFAULT.clone()
19827 }
19828}
19829impl MessageData for MISSION_ITEM_INT_DATA {
19830 type Message = MavMessage;
19831 const ID: u32 = 73u32;
19832 const NAME: &'static str = "MISSION_ITEM_INT";
19833 const EXTRA_CRC: u8 = 38u8;
19834 const ENCODED_LEN: usize = 38usize;
19835 fn deser(
19836 _version: MavlinkVersion,
19837 __input: &[u8],
19838 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19839 let avail_len = __input.len();
19840 let mut payload_buf = [0; Self::ENCODED_LEN];
19841 let mut buf = if avail_len < Self::ENCODED_LEN {
19842 payload_buf[0..avail_len].copy_from_slice(__input);
19843 Bytes::new(&payload_buf)
19844 } else {
19845 Bytes::new(__input)
19846 };
19847 let mut __struct = Self::default();
19848 __struct.param1 = buf.get_f32_le();
19849 __struct.param2 = buf.get_f32_le();
19850 __struct.param3 = buf.get_f32_le();
19851 __struct.param4 = buf.get_f32_le();
19852 __struct.x = buf.get_i32_le();
19853 __struct.y = buf.get_i32_le();
19854 __struct.z = buf.get_f32_le();
19855 __struct.seq = buf.get_u16_le();
19856 let tmp = buf.get_u16_le();
19857 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19858 ::mavlink_core::error::ParserError::InvalidEnum {
19859 enum_type: "MavCmd",
19860 value: tmp as u64,
19861 },
19862 )?;
19863 __struct.target_system = buf.get_u8();
19864 __struct.target_component = buf.get_u8();
19865 let tmp = buf.get_u8();
19866 __struct.frame =
19867 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19868 enum_type: "MavFrame",
19869 value: tmp as u64,
19870 })?;
19871 __struct.current = buf.get_u8();
19872 __struct.autocontinue = buf.get_u8();
19873 let tmp = buf.get_u8();
19874 __struct.mission_type =
19875 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19876 enum_type: "MavMissionType",
19877 value: tmp as u64,
19878 })?;
19879 Ok(__struct)
19880 }
19881 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19882 let mut __tmp = BytesMut::new(bytes);
19883 #[allow(clippy::absurd_extreme_comparisons)]
19884 #[allow(unused_comparisons)]
19885 if __tmp.remaining() < Self::ENCODED_LEN {
19886 panic!(
19887 "buffer is too small (need {} bytes, but got {})",
19888 Self::ENCODED_LEN,
19889 __tmp.remaining(),
19890 )
19891 }
19892 __tmp.put_f32_le(self.param1);
19893 __tmp.put_f32_le(self.param2);
19894 __tmp.put_f32_le(self.param3);
19895 __tmp.put_f32_le(self.param4);
19896 __tmp.put_i32_le(self.x);
19897 __tmp.put_i32_le(self.y);
19898 __tmp.put_f32_le(self.z);
19899 __tmp.put_u16_le(self.seq);
19900 __tmp.put_u16_le(self.command as u16);
19901 __tmp.put_u8(self.target_system);
19902 __tmp.put_u8(self.target_component);
19903 __tmp.put_u8(self.frame as u8);
19904 __tmp.put_u8(self.current);
19905 __tmp.put_u8(self.autocontinue);
19906 if matches!(version, MavlinkVersion::V2) {
19907 __tmp.put_u8(self.mission_type as u8);
19908 let len = __tmp.len();
19909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19910 } else {
19911 __tmp.len()
19912 }
19913 }
19914}
19915#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
19916#[doc = ""]
19917#[doc = "ID: 46"]
19918#[derive(Debug, Clone, PartialEq)]
19919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19921#[cfg_attr(feature = "ts", derive(TS))]
19922#[cfg_attr(feature = "ts", ts(export))]
19923pub struct MISSION_ITEM_REACHED_DATA {
19924 #[doc = "Sequence"]
19925 pub seq: u16,
19926}
19927impl MISSION_ITEM_REACHED_DATA {
19928 pub const ENCODED_LEN: usize = 2usize;
19929 pub const DEFAULT: Self = Self { seq: 0_u16 };
19930 #[cfg(feature = "arbitrary")]
19931 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19932 use arbitrary::{Arbitrary, Unstructured};
19933 let mut buf = [0u8; 1024];
19934 rng.fill_bytes(&mut buf);
19935 let mut unstructured = Unstructured::new(&buf);
19936 Self::arbitrary(&mut unstructured).unwrap_or_default()
19937 }
19938}
19939impl Default for MISSION_ITEM_REACHED_DATA {
19940 fn default() -> Self {
19941 Self::DEFAULT.clone()
19942 }
19943}
19944impl MessageData for MISSION_ITEM_REACHED_DATA {
19945 type Message = MavMessage;
19946 const ID: u32 = 46u32;
19947 const NAME: &'static str = "MISSION_ITEM_REACHED";
19948 const EXTRA_CRC: u8 = 11u8;
19949 const ENCODED_LEN: usize = 2usize;
19950 fn deser(
19951 _version: MavlinkVersion,
19952 __input: &[u8],
19953 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19954 let avail_len = __input.len();
19955 let mut payload_buf = [0; Self::ENCODED_LEN];
19956 let mut buf = if avail_len < Self::ENCODED_LEN {
19957 payload_buf[0..avail_len].copy_from_slice(__input);
19958 Bytes::new(&payload_buf)
19959 } else {
19960 Bytes::new(__input)
19961 };
19962 let mut __struct = Self::default();
19963 __struct.seq = buf.get_u16_le();
19964 Ok(__struct)
19965 }
19966 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19967 let mut __tmp = BytesMut::new(bytes);
19968 #[allow(clippy::absurd_extreme_comparisons)]
19969 #[allow(unused_comparisons)]
19970 if __tmp.remaining() < Self::ENCODED_LEN {
19971 panic!(
19972 "buffer is too small (need {} bytes, but got {})",
19973 Self::ENCODED_LEN,
19974 __tmp.remaining(),
19975 )
19976 }
19977 __tmp.put_u16_le(self.seq);
19978 if matches!(version, MavlinkVersion::V2) {
19979 let len = __tmp.len();
19980 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19981 } else {
19982 __tmp.len()
19983 }
19984 }
19985}
19986#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
19987#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
19988#[doc = ""]
19989#[doc = "ID: 40"]
19990#[derive(Debug, Clone, PartialEq)]
19991#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19993#[cfg_attr(feature = "ts", derive(TS))]
19994#[cfg_attr(feature = "ts", ts(export))]
19995pub struct MISSION_REQUEST_DATA {
19996 #[doc = "Sequence"]
19997 pub seq: u16,
19998 #[doc = "System ID"]
19999 pub target_system: u8,
20000 #[doc = "Component ID"]
20001 pub target_component: u8,
20002 #[doc = "Mission type."]
20003 #[cfg_attr(feature = "serde", serde(default))]
20004 pub mission_type: MavMissionType,
20005}
20006impl MISSION_REQUEST_DATA {
20007 pub const ENCODED_LEN: usize = 5usize;
20008 pub const DEFAULT: Self = Self {
20009 seq: 0_u16,
20010 target_system: 0_u8,
20011 target_component: 0_u8,
20012 mission_type: MavMissionType::DEFAULT,
20013 };
20014 #[cfg(feature = "arbitrary")]
20015 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20016 use arbitrary::{Arbitrary, Unstructured};
20017 let mut buf = [0u8; 1024];
20018 rng.fill_bytes(&mut buf);
20019 let mut unstructured = Unstructured::new(&buf);
20020 Self::arbitrary(&mut unstructured).unwrap_or_default()
20021 }
20022}
20023impl Default for MISSION_REQUEST_DATA {
20024 fn default() -> Self {
20025 Self::DEFAULT.clone()
20026 }
20027}
20028impl MessageData for MISSION_REQUEST_DATA {
20029 type Message = MavMessage;
20030 const ID: u32 = 40u32;
20031 const NAME: &'static str = "MISSION_REQUEST";
20032 const EXTRA_CRC: u8 = 230u8;
20033 const ENCODED_LEN: usize = 5usize;
20034 fn deser(
20035 _version: MavlinkVersion,
20036 __input: &[u8],
20037 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20038 let avail_len = __input.len();
20039 let mut payload_buf = [0; Self::ENCODED_LEN];
20040 let mut buf = if avail_len < Self::ENCODED_LEN {
20041 payload_buf[0..avail_len].copy_from_slice(__input);
20042 Bytes::new(&payload_buf)
20043 } else {
20044 Bytes::new(__input)
20045 };
20046 let mut __struct = Self::default();
20047 __struct.seq = buf.get_u16_le();
20048 __struct.target_system = buf.get_u8();
20049 __struct.target_component = buf.get_u8();
20050 let tmp = buf.get_u8();
20051 __struct.mission_type =
20052 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20053 enum_type: "MavMissionType",
20054 value: tmp as u64,
20055 })?;
20056 Ok(__struct)
20057 }
20058 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20059 let mut __tmp = BytesMut::new(bytes);
20060 #[allow(clippy::absurd_extreme_comparisons)]
20061 #[allow(unused_comparisons)]
20062 if __tmp.remaining() < Self::ENCODED_LEN {
20063 panic!(
20064 "buffer is too small (need {} bytes, but got {})",
20065 Self::ENCODED_LEN,
20066 __tmp.remaining(),
20067 )
20068 }
20069 __tmp.put_u16_le(self.seq);
20070 __tmp.put_u8(self.target_system);
20071 __tmp.put_u8(self.target_component);
20072 if matches!(version, MavlinkVersion::V2) {
20073 __tmp.put_u8(self.mission_type as u8);
20074 let len = __tmp.len();
20075 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20076 } else {
20077 __tmp.len()
20078 }
20079 }
20080}
20081#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20082#[doc = ""]
20083#[doc = "ID: 51"]
20084#[derive(Debug, Clone, PartialEq)]
20085#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20087#[cfg_attr(feature = "ts", derive(TS))]
20088#[cfg_attr(feature = "ts", ts(export))]
20089pub struct MISSION_REQUEST_INT_DATA {
20090 #[doc = "Sequence"]
20091 pub seq: u16,
20092 #[doc = "System ID"]
20093 pub target_system: u8,
20094 #[doc = "Component ID"]
20095 pub target_component: u8,
20096 #[doc = "Mission type."]
20097 #[cfg_attr(feature = "serde", serde(default))]
20098 pub mission_type: MavMissionType,
20099}
20100impl MISSION_REQUEST_INT_DATA {
20101 pub const ENCODED_LEN: usize = 5usize;
20102 pub const DEFAULT: Self = Self {
20103 seq: 0_u16,
20104 target_system: 0_u8,
20105 target_component: 0_u8,
20106 mission_type: MavMissionType::DEFAULT,
20107 };
20108 #[cfg(feature = "arbitrary")]
20109 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20110 use arbitrary::{Arbitrary, Unstructured};
20111 let mut buf = [0u8; 1024];
20112 rng.fill_bytes(&mut buf);
20113 let mut unstructured = Unstructured::new(&buf);
20114 Self::arbitrary(&mut unstructured).unwrap_or_default()
20115 }
20116}
20117impl Default for MISSION_REQUEST_INT_DATA {
20118 fn default() -> Self {
20119 Self::DEFAULT.clone()
20120 }
20121}
20122impl MessageData for MISSION_REQUEST_INT_DATA {
20123 type Message = MavMessage;
20124 const ID: u32 = 51u32;
20125 const NAME: &'static str = "MISSION_REQUEST_INT";
20126 const EXTRA_CRC: u8 = 196u8;
20127 const ENCODED_LEN: usize = 5usize;
20128 fn deser(
20129 _version: MavlinkVersion,
20130 __input: &[u8],
20131 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20132 let avail_len = __input.len();
20133 let mut payload_buf = [0; Self::ENCODED_LEN];
20134 let mut buf = if avail_len < Self::ENCODED_LEN {
20135 payload_buf[0..avail_len].copy_from_slice(__input);
20136 Bytes::new(&payload_buf)
20137 } else {
20138 Bytes::new(__input)
20139 };
20140 let mut __struct = Self::default();
20141 __struct.seq = buf.get_u16_le();
20142 __struct.target_system = buf.get_u8();
20143 __struct.target_component = buf.get_u8();
20144 let tmp = buf.get_u8();
20145 __struct.mission_type =
20146 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20147 enum_type: "MavMissionType",
20148 value: tmp as u64,
20149 })?;
20150 Ok(__struct)
20151 }
20152 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20153 let mut __tmp = BytesMut::new(bytes);
20154 #[allow(clippy::absurd_extreme_comparisons)]
20155 #[allow(unused_comparisons)]
20156 if __tmp.remaining() < Self::ENCODED_LEN {
20157 panic!(
20158 "buffer is too small (need {} bytes, but got {})",
20159 Self::ENCODED_LEN,
20160 __tmp.remaining(),
20161 )
20162 }
20163 __tmp.put_u16_le(self.seq);
20164 __tmp.put_u8(self.target_system);
20165 __tmp.put_u8(self.target_component);
20166 if matches!(version, MavlinkVersion::V2) {
20167 __tmp.put_u8(self.mission_type as u8);
20168 let len = __tmp.len();
20169 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20170 } else {
20171 __tmp.len()
20172 }
20173 }
20174}
20175#[doc = "Request the overall list of mission items from the system/component."]
20176#[doc = ""]
20177#[doc = "ID: 43"]
20178#[derive(Debug, Clone, PartialEq)]
20179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20180#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20181#[cfg_attr(feature = "ts", derive(TS))]
20182#[cfg_attr(feature = "ts", ts(export))]
20183pub struct MISSION_REQUEST_LIST_DATA {
20184 #[doc = "System ID"]
20185 pub target_system: u8,
20186 #[doc = "Component ID"]
20187 pub target_component: u8,
20188 #[doc = "Mission type."]
20189 #[cfg_attr(feature = "serde", serde(default))]
20190 pub mission_type: MavMissionType,
20191}
20192impl MISSION_REQUEST_LIST_DATA {
20193 pub const ENCODED_LEN: usize = 3usize;
20194 pub const DEFAULT: Self = Self {
20195 target_system: 0_u8,
20196 target_component: 0_u8,
20197 mission_type: MavMissionType::DEFAULT,
20198 };
20199 #[cfg(feature = "arbitrary")]
20200 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20201 use arbitrary::{Arbitrary, Unstructured};
20202 let mut buf = [0u8; 1024];
20203 rng.fill_bytes(&mut buf);
20204 let mut unstructured = Unstructured::new(&buf);
20205 Self::arbitrary(&mut unstructured).unwrap_or_default()
20206 }
20207}
20208impl Default for MISSION_REQUEST_LIST_DATA {
20209 fn default() -> Self {
20210 Self::DEFAULT.clone()
20211 }
20212}
20213impl MessageData for MISSION_REQUEST_LIST_DATA {
20214 type Message = MavMessage;
20215 const ID: u32 = 43u32;
20216 const NAME: &'static str = "MISSION_REQUEST_LIST";
20217 const EXTRA_CRC: u8 = 132u8;
20218 const ENCODED_LEN: usize = 3usize;
20219 fn deser(
20220 _version: MavlinkVersion,
20221 __input: &[u8],
20222 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20223 let avail_len = __input.len();
20224 let mut payload_buf = [0; Self::ENCODED_LEN];
20225 let mut buf = if avail_len < Self::ENCODED_LEN {
20226 payload_buf[0..avail_len].copy_from_slice(__input);
20227 Bytes::new(&payload_buf)
20228 } else {
20229 Bytes::new(__input)
20230 };
20231 let mut __struct = Self::default();
20232 __struct.target_system = buf.get_u8();
20233 __struct.target_component = buf.get_u8();
20234 let tmp = buf.get_u8();
20235 __struct.mission_type =
20236 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20237 enum_type: "MavMissionType",
20238 value: tmp as u64,
20239 })?;
20240 Ok(__struct)
20241 }
20242 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20243 let mut __tmp = BytesMut::new(bytes);
20244 #[allow(clippy::absurd_extreme_comparisons)]
20245 #[allow(unused_comparisons)]
20246 if __tmp.remaining() < Self::ENCODED_LEN {
20247 panic!(
20248 "buffer is too small (need {} bytes, but got {})",
20249 Self::ENCODED_LEN,
20250 __tmp.remaining(),
20251 )
20252 }
20253 __tmp.put_u8(self.target_system);
20254 __tmp.put_u8(self.target_component);
20255 if matches!(version, MavlinkVersion::V2) {
20256 __tmp.put_u8(self.mission_type as u8);
20257 let len = __tmp.len();
20258 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20259 } else {
20260 __tmp.len()
20261 }
20262 }
20263}
20264#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
20265#[doc = ""]
20266#[doc = "ID: 37"]
20267#[derive(Debug, Clone, PartialEq)]
20268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20270#[cfg_attr(feature = "ts", derive(TS))]
20271#[cfg_attr(feature = "ts", ts(export))]
20272pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
20273 #[doc = "Start index"]
20274 pub start_index: i16,
20275 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
20276 pub end_index: i16,
20277 #[doc = "System ID"]
20278 pub target_system: u8,
20279 #[doc = "Component ID"]
20280 pub target_component: u8,
20281 #[doc = "Mission type."]
20282 #[cfg_attr(feature = "serde", serde(default))]
20283 pub mission_type: MavMissionType,
20284}
20285impl MISSION_REQUEST_PARTIAL_LIST_DATA {
20286 pub const ENCODED_LEN: usize = 7usize;
20287 pub const DEFAULT: Self = Self {
20288 start_index: 0_i16,
20289 end_index: 0_i16,
20290 target_system: 0_u8,
20291 target_component: 0_u8,
20292 mission_type: MavMissionType::DEFAULT,
20293 };
20294 #[cfg(feature = "arbitrary")]
20295 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20296 use arbitrary::{Arbitrary, Unstructured};
20297 let mut buf = [0u8; 1024];
20298 rng.fill_bytes(&mut buf);
20299 let mut unstructured = Unstructured::new(&buf);
20300 Self::arbitrary(&mut unstructured).unwrap_or_default()
20301 }
20302}
20303impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20304 fn default() -> Self {
20305 Self::DEFAULT.clone()
20306 }
20307}
20308impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20309 type Message = MavMessage;
20310 const ID: u32 = 37u32;
20311 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20312 const EXTRA_CRC: u8 = 212u8;
20313 const ENCODED_LEN: usize = 7usize;
20314 fn deser(
20315 _version: MavlinkVersion,
20316 __input: &[u8],
20317 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20318 let avail_len = __input.len();
20319 let mut payload_buf = [0; Self::ENCODED_LEN];
20320 let mut buf = if avail_len < Self::ENCODED_LEN {
20321 payload_buf[0..avail_len].copy_from_slice(__input);
20322 Bytes::new(&payload_buf)
20323 } else {
20324 Bytes::new(__input)
20325 };
20326 let mut __struct = Self::default();
20327 __struct.start_index = buf.get_i16_le();
20328 __struct.end_index = buf.get_i16_le();
20329 __struct.target_system = buf.get_u8();
20330 __struct.target_component = buf.get_u8();
20331 let tmp = buf.get_u8();
20332 __struct.mission_type =
20333 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20334 enum_type: "MavMissionType",
20335 value: tmp as u64,
20336 })?;
20337 Ok(__struct)
20338 }
20339 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20340 let mut __tmp = BytesMut::new(bytes);
20341 #[allow(clippy::absurd_extreme_comparisons)]
20342 #[allow(unused_comparisons)]
20343 if __tmp.remaining() < Self::ENCODED_LEN {
20344 panic!(
20345 "buffer is too small (need {} bytes, but got {})",
20346 Self::ENCODED_LEN,
20347 __tmp.remaining(),
20348 )
20349 }
20350 __tmp.put_i16_le(self.start_index);
20351 __tmp.put_i16_le(self.end_index);
20352 __tmp.put_u8(self.target_system);
20353 __tmp.put_u8(self.target_component);
20354 if matches!(version, MavlinkVersion::V2) {
20355 __tmp.put_u8(self.mission_type as u8);
20356 let len = __tmp.len();
20357 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20358 } else {
20359 __tmp.len()
20360 }
20361 }
20362}
20363#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20364#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20365#[doc = ""]
20366#[doc = "ID: 41"]
20367#[derive(Debug, Clone, PartialEq)]
20368#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20369#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20370#[cfg_attr(feature = "ts", derive(TS))]
20371#[cfg_attr(feature = "ts", ts(export))]
20372pub struct MISSION_SET_CURRENT_DATA {
20373 #[doc = "Sequence"]
20374 pub seq: u16,
20375 #[doc = "System ID"]
20376 pub target_system: u8,
20377 #[doc = "Component ID"]
20378 pub target_component: u8,
20379}
20380impl MISSION_SET_CURRENT_DATA {
20381 pub const ENCODED_LEN: usize = 4usize;
20382 pub const DEFAULT: Self = Self {
20383 seq: 0_u16,
20384 target_system: 0_u8,
20385 target_component: 0_u8,
20386 };
20387 #[cfg(feature = "arbitrary")]
20388 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20389 use arbitrary::{Arbitrary, Unstructured};
20390 let mut buf = [0u8; 1024];
20391 rng.fill_bytes(&mut buf);
20392 let mut unstructured = Unstructured::new(&buf);
20393 Self::arbitrary(&mut unstructured).unwrap_or_default()
20394 }
20395}
20396impl Default for MISSION_SET_CURRENT_DATA {
20397 fn default() -> Self {
20398 Self::DEFAULT.clone()
20399 }
20400}
20401impl MessageData for MISSION_SET_CURRENT_DATA {
20402 type Message = MavMessage;
20403 const ID: u32 = 41u32;
20404 const NAME: &'static str = "MISSION_SET_CURRENT";
20405 const EXTRA_CRC: u8 = 28u8;
20406 const ENCODED_LEN: usize = 4usize;
20407 fn deser(
20408 _version: MavlinkVersion,
20409 __input: &[u8],
20410 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20411 let avail_len = __input.len();
20412 let mut payload_buf = [0; Self::ENCODED_LEN];
20413 let mut buf = if avail_len < Self::ENCODED_LEN {
20414 payload_buf[0..avail_len].copy_from_slice(__input);
20415 Bytes::new(&payload_buf)
20416 } else {
20417 Bytes::new(__input)
20418 };
20419 let mut __struct = Self::default();
20420 __struct.seq = buf.get_u16_le();
20421 __struct.target_system = buf.get_u8();
20422 __struct.target_component = buf.get_u8();
20423 Ok(__struct)
20424 }
20425 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20426 let mut __tmp = BytesMut::new(bytes);
20427 #[allow(clippy::absurd_extreme_comparisons)]
20428 #[allow(unused_comparisons)]
20429 if __tmp.remaining() < Self::ENCODED_LEN {
20430 panic!(
20431 "buffer is too small (need {} bytes, but got {})",
20432 Self::ENCODED_LEN,
20433 __tmp.remaining(),
20434 )
20435 }
20436 __tmp.put_u16_le(self.seq);
20437 __tmp.put_u8(self.target_system);
20438 __tmp.put_u8(self.target_component);
20439 if matches!(version, MavlinkVersion::V2) {
20440 let len = __tmp.len();
20441 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20442 } else {
20443 __tmp.len()
20444 }
20445 }
20446}
20447#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
20448#[doc = ""]
20449#[doc = "ID: 38"]
20450#[derive(Debug, Clone, PartialEq)]
20451#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20452#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20453#[cfg_attr(feature = "ts", derive(TS))]
20454#[cfg_attr(feature = "ts", ts(export))]
20455pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
20456 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20457 pub start_index: i16,
20458 #[doc = "End index, equal or greater than start index."]
20459 pub end_index: i16,
20460 #[doc = "System ID"]
20461 pub target_system: u8,
20462 #[doc = "Component ID"]
20463 pub target_component: u8,
20464 #[doc = "Mission type."]
20465 #[cfg_attr(feature = "serde", serde(default))]
20466 pub mission_type: MavMissionType,
20467}
20468impl MISSION_WRITE_PARTIAL_LIST_DATA {
20469 pub const ENCODED_LEN: usize = 7usize;
20470 pub const DEFAULT: Self = Self {
20471 start_index: 0_i16,
20472 end_index: 0_i16,
20473 target_system: 0_u8,
20474 target_component: 0_u8,
20475 mission_type: MavMissionType::DEFAULT,
20476 };
20477 #[cfg(feature = "arbitrary")]
20478 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20479 use arbitrary::{Arbitrary, Unstructured};
20480 let mut buf = [0u8; 1024];
20481 rng.fill_bytes(&mut buf);
20482 let mut unstructured = Unstructured::new(&buf);
20483 Self::arbitrary(&mut unstructured).unwrap_or_default()
20484 }
20485}
20486impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20487 fn default() -> Self {
20488 Self::DEFAULT.clone()
20489 }
20490}
20491impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20492 type Message = MavMessage;
20493 const ID: u32 = 38u32;
20494 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20495 const EXTRA_CRC: u8 = 9u8;
20496 const ENCODED_LEN: usize = 7usize;
20497 fn deser(
20498 _version: MavlinkVersion,
20499 __input: &[u8],
20500 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20501 let avail_len = __input.len();
20502 let mut payload_buf = [0; Self::ENCODED_LEN];
20503 let mut buf = if avail_len < Self::ENCODED_LEN {
20504 payload_buf[0..avail_len].copy_from_slice(__input);
20505 Bytes::new(&payload_buf)
20506 } else {
20507 Bytes::new(__input)
20508 };
20509 let mut __struct = Self::default();
20510 __struct.start_index = buf.get_i16_le();
20511 __struct.end_index = buf.get_i16_le();
20512 __struct.target_system = buf.get_u8();
20513 __struct.target_component = buf.get_u8();
20514 let tmp = buf.get_u8();
20515 __struct.mission_type =
20516 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20517 enum_type: "MavMissionType",
20518 value: tmp as u64,
20519 })?;
20520 Ok(__struct)
20521 }
20522 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20523 let mut __tmp = BytesMut::new(bytes);
20524 #[allow(clippy::absurd_extreme_comparisons)]
20525 #[allow(unused_comparisons)]
20526 if __tmp.remaining() < Self::ENCODED_LEN {
20527 panic!(
20528 "buffer is too small (need {} bytes, but got {})",
20529 Self::ENCODED_LEN,
20530 __tmp.remaining(),
20531 )
20532 }
20533 __tmp.put_i16_le(self.start_index);
20534 __tmp.put_i16_le(self.end_index);
20535 __tmp.put_u8(self.target_system);
20536 __tmp.put_u8(self.target_component);
20537 if matches!(version, MavlinkVersion::V2) {
20538 __tmp.put_u8(self.mission_type as u8);
20539 let len = __tmp.len();
20540 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20541 } else {
20542 __tmp.len()
20543 }
20544 }
20545}
20546#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
20547#[doc = "Orientation of a mount."]
20548#[doc = ""]
20549#[doc = "ID: 265"]
20550#[derive(Debug, Clone, PartialEq)]
20551#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20552#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20553#[cfg_attr(feature = "ts", derive(TS))]
20554#[cfg_attr(feature = "ts", ts(export))]
20555pub struct MOUNT_ORIENTATION_DATA {
20556 #[doc = "Timestamp (time since system boot)."]
20557 pub time_boot_ms: u32,
20558 #[doc = "Roll in global frame (set to NaN for invalid)."]
20559 pub roll: f32,
20560 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20561 pub pitch: f32,
20562 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20563 pub yaw: f32,
20564 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20565 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20566 pub yaw_absolute: f32,
20567}
20568impl MOUNT_ORIENTATION_DATA {
20569 pub const ENCODED_LEN: usize = 20usize;
20570 pub const DEFAULT: Self = Self {
20571 time_boot_ms: 0_u32,
20572 roll: 0.0_f32,
20573 pitch: 0.0_f32,
20574 yaw: 0.0_f32,
20575 yaw_absolute: 0.0_f32,
20576 };
20577 #[cfg(feature = "arbitrary")]
20578 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20579 use arbitrary::{Arbitrary, Unstructured};
20580 let mut buf = [0u8; 1024];
20581 rng.fill_bytes(&mut buf);
20582 let mut unstructured = Unstructured::new(&buf);
20583 Self::arbitrary(&mut unstructured).unwrap_or_default()
20584 }
20585}
20586impl Default for MOUNT_ORIENTATION_DATA {
20587 fn default() -> Self {
20588 Self::DEFAULT.clone()
20589 }
20590}
20591impl MessageData for MOUNT_ORIENTATION_DATA {
20592 type Message = MavMessage;
20593 const ID: u32 = 265u32;
20594 const NAME: &'static str = "MOUNT_ORIENTATION";
20595 const EXTRA_CRC: u8 = 26u8;
20596 const ENCODED_LEN: usize = 20usize;
20597 fn deser(
20598 _version: MavlinkVersion,
20599 __input: &[u8],
20600 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20601 let avail_len = __input.len();
20602 let mut payload_buf = [0; Self::ENCODED_LEN];
20603 let mut buf = if avail_len < Self::ENCODED_LEN {
20604 payload_buf[0..avail_len].copy_from_slice(__input);
20605 Bytes::new(&payload_buf)
20606 } else {
20607 Bytes::new(__input)
20608 };
20609 let mut __struct = Self::default();
20610 __struct.time_boot_ms = buf.get_u32_le();
20611 __struct.roll = buf.get_f32_le();
20612 __struct.pitch = buf.get_f32_le();
20613 __struct.yaw = buf.get_f32_le();
20614 __struct.yaw_absolute = buf.get_f32_le();
20615 Ok(__struct)
20616 }
20617 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20618 let mut __tmp = BytesMut::new(bytes);
20619 #[allow(clippy::absurd_extreme_comparisons)]
20620 #[allow(unused_comparisons)]
20621 if __tmp.remaining() < Self::ENCODED_LEN {
20622 panic!(
20623 "buffer is too small (need {} bytes, but got {})",
20624 Self::ENCODED_LEN,
20625 __tmp.remaining(),
20626 )
20627 }
20628 __tmp.put_u32_le(self.time_boot_ms);
20629 __tmp.put_f32_le(self.roll);
20630 __tmp.put_f32_le(self.pitch);
20631 __tmp.put_f32_le(self.yaw);
20632 if matches!(version, MavlinkVersion::V2) {
20633 __tmp.put_f32_le(self.yaw_absolute);
20634 let len = __tmp.len();
20635 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20636 } else {
20637 __tmp.len()
20638 }
20639 }
20640}
20641#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20642#[doc = ""]
20643#[doc = "ID: 251"]
20644#[derive(Debug, Clone, PartialEq)]
20645#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20646#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20647#[cfg_attr(feature = "ts", derive(TS))]
20648#[cfg_attr(feature = "ts", ts(export))]
20649pub struct NAMED_VALUE_FLOAT_DATA {
20650 #[doc = "Timestamp (time since system boot)."]
20651 pub time_boot_ms: u32,
20652 #[doc = "Floating point value"]
20653 pub value: f32,
20654 #[doc = "Name of the debug variable"]
20655 #[cfg_attr(feature = "ts", ts(type = "string"))]
20656 pub name: CharArray<10>,
20657}
20658impl NAMED_VALUE_FLOAT_DATA {
20659 pub const ENCODED_LEN: usize = 18usize;
20660 pub const DEFAULT: Self = Self {
20661 time_boot_ms: 0_u32,
20662 value: 0.0_f32,
20663 name: CharArray::new([0_u8; 10usize]),
20664 };
20665 #[cfg(feature = "arbitrary")]
20666 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20667 use arbitrary::{Arbitrary, Unstructured};
20668 let mut buf = [0u8; 1024];
20669 rng.fill_bytes(&mut buf);
20670 let mut unstructured = Unstructured::new(&buf);
20671 Self::arbitrary(&mut unstructured).unwrap_or_default()
20672 }
20673}
20674impl Default for NAMED_VALUE_FLOAT_DATA {
20675 fn default() -> Self {
20676 Self::DEFAULT.clone()
20677 }
20678}
20679impl MessageData for NAMED_VALUE_FLOAT_DATA {
20680 type Message = MavMessage;
20681 const ID: u32 = 251u32;
20682 const NAME: &'static str = "NAMED_VALUE_FLOAT";
20683 const EXTRA_CRC: u8 = 170u8;
20684 const ENCODED_LEN: usize = 18usize;
20685 fn deser(
20686 _version: MavlinkVersion,
20687 __input: &[u8],
20688 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20689 let avail_len = __input.len();
20690 let mut payload_buf = [0; Self::ENCODED_LEN];
20691 let mut buf = if avail_len < Self::ENCODED_LEN {
20692 payload_buf[0..avail_len].copy_from_slice(__input);
20693 Bytes::new(&payload_buf)
20694 } else {
20695 Bytes::new(__input)
20696 };
20697 let mut __struct = Self::default();
20698 __struct.time_boot_ms = buf.get_u32_le();
20699 __struct.value = buf.get_f32_le();
20700 let mut tmp = [0_u8; 10usize];
20701 for v in &mut tmp {
20702 *v = buf.get_u8();
20703 }
20704 __struct.name = CharArray::new(tmp);
20705 Ok(__struct)
20706 }
20707 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20708 let mut __tmp = BytesMut::new(bytes);
20709 #[allow(clippy::absurd_extreme_comparisons)]
20710 #[allow(unused_comparisons)]
20711 if __tmp.remaining() < Self::ENCODED_LEN {
20712 panic!(
20713 "buffer is too small (need {} bytes, but got {})",
20714 Self::ENCODED_LEN,
20715 __tmp.remaining(),
20716 )
20717 }
20718 __tmp.put_u32_le(self.time_boot_ms);
20719 __tmp.put_f32_le(self.value);
20720 for val in &self.name {
20721 __tmp.put_u8(*val);
20722 }
20723 if matches!(version, MavlinkVersion::V2) {
20724 let len = __tmp.len();
20725 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20726 } else {
20727 __tmp.len()
20728 }
20729 }
20730}
20731#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20732#[doc = ""]
20733#[doc = "ID: 252"]
20734#[derive(Debug, Clone, PartialEq)]
20735#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20736#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20737#[cfg_attr(feature = "ts", derive(TS))]
20738#[cfg_attr(feature = "ts", ts(export))]
20739pub struct NAMED_VALUE_INT_DATA {
20740 #[doc = "Timestamp (time since system boot)."]
20741 pub time_boot_ms: u32,
20742 #[doc = "Signed integer value"]
20743 pub value: i32,
20744 #[doc = "Name of the debug variable"]
20745 #[cfg_attr(feature = "ts", ts(type = "string"))]
20746 pub name: CharArray<10>,
20747}
20748impl NAMED_VALUE_INT_DATA {
20749 pub const ENCODED_LEN: usize = 18usize;
20750 pub const DEFAULT: Self = Self {
20751 time_boot_ms: 0_u32,
20752 value: 0_i32,
20753 name: CharArray::new([0_u8; 10usize]),
20754 };
20755 #[cfg(feature = "arbitrary")]
20756 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20757 use arbitrary::{Arbitrary, Unstructured};
20758 let mut buf = [0u8; 1024];
20759 rng.fill_bytes(&mut buf);
20760 let mut unstructured = Unstructured::new(&buf);
20761 Self::arbitrary(&mut unstructured).unwrap_or_default()
20762 }
20763}
20764impl Default for NAMED_VALUE_INT_DATA {
20765 fn default() -> Self {
20766 Self::DEFAULT.clone()
20767 }
20768}
20769impl MessageData for NAMED_VALUE_INT_DATA {
20770 type Message = MavMessage;
20771 const ID: u32 = 252u32;
20772 const NAME: &'static str = "NAMED_VALUE_INT";
20773 const EXTRA_CRC: u8 = 44u8;
20774 const ENCODED_LEN: usize = 18usize;
20775 fn deser(
20776 _version: MavlinkVersion,
20777 __input: &[u8],
20778 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20779 let avail_len = __input.len();
20780 let mut payload_buf = [0; Self::ENCODED_LEN];
20781 let mut buf = if avail_len < Self::ENCODED_LEN {
20782 payload_buf[0..avail_len].copy_from_slice(__input);
20783 Bytes::new(&payload_buf)
20784 } else {
20785 Bytes::new(__input)
20786 };
20787 let mut __struct = Self::default();
20788 __struct.time_boot_ms = buf.get_u32_le();
20789 __struct.value = buf.get_i32_le();
20790 let mut tmp = [0_u8; 10usize];
20791 for v in &mut tmp {
20792 *v = buf.get_u8();
20793 }
20794 __struct.name = CharArray::new(tmp);
20795 Ok(__struct)
20796 }
20797 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20798 let mut __tmp = BytesMut::new(bytes);
20799 #[allow(clippy::absurd_extreme_comparisons)]
20800 #[allow(unused_comparisons)]
20801 if __tmp.remaining() < Self::ENCODED_LEN {
20802 panic!(
20803 "buffer is too small (need {} bytes, but got {})",
20804 Self::ENCODED_LEN,
20805 __tmp.remaining(),
20806 )
20807 }
20808 __tmp.put_u32_le(self.time_boot_ms);
20809 __tmp.put_i32_le(self.value);
20810 for val in &self.name {
20811 __tmp.put_u8(*val);
20812 }
20813 if matches!(version, MavlinkVersion::V2) {
20814 let len = __tmp.len();
20815 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20816 } else {
20817 __tmp.len()
20818 }
20819 }
20820}
20821#[doc = "The state of the navigation and position controller."]
20822#[doc = ""]
20823#[doc = "ID: 62"]
20824#[derive(Debug, Clone, PartialEq)]
20825#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20826#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20827#[cfg_attr(feature = "ts", derive(TS))]
20828#[cfg_attr(feature = "ts", ts(export))]
20829pub struct NAV_CONTROLLER_OUTPUT_DATA {
20830 #[doc = "Current desired roll"]
20831 pub nav_roll: f32,
20832 #[doc = "Current desired pitch"]
20833 pub nav_pitch: f32,
20834 #[doc = "Current altitude error"]
20835 pub alt_error: f32,
20836 #[doc = "Current airspeed error"]
20837 pub aspd_error: f32,
20838 #[doc = "Current crosstrack error on x-y plane"]
20839 pub xtrack_error: f32,
20840 #[doc = "Current desired heading"]
20841 pub nav_bearing: i16,
20842 #[doc = "Bearing to current waypoint/target"]
20843 pub target_bearing: i16,
20844 #[doc = "Distance to active waypoint"]
20845 pub wp_dist: u16,
20846}
20847impl NAV_CONTROLLER_OUTPUT_DATA {
20848 pub const ENCODED_LEN: usize = 26usize;
20849 pub const DEFAULT: Self = Self {
20850 nav_roll: 0.0_f32,
20851 nav_pitch: 0.0_f32,
20852 alt_error: 0.0_f32,
20853 aspd_error: 0.0_f32,
20854 xtrack_error: 0.0_f32,
20855 nav_bearing: 0_i16,
20856 target_bearing: 0_i16,
20857 wp_dist: 0_u16,
20858 };
20859 #[cfg(feature = "arbitrary")]
20860 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20861 use arbitrary::{Arbitrary, Unstructured};
20862 let mut buf = [0u8; 1024];
20863 rng.fill_bytes(&mut buf);
20864 let mut unstructured = Unstructured::new(&buf);
20865 Self::arbitrary(&mut unstructured).unwrap_or_default()
20866 }
20867}
20868impl Default for NAV_CONTROLLER_OUTPUT_DATA {
20869 fn default() -> Self {
20870 Self::DEFAULT.clone()
20871 }
20872}
20873impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
20874 type Message = MavMessage;
20875 const ID: u32 = 62u32;
20876 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
20877 const EXTRA_CRC: u8 = 183u8;
20878 const ENCODED_LEN: usize = 26usize;
20879 fn deser(
20880 _version: MavlinkVersion,
20881 __input: &[u8],
20882 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20883 let avail_len = __input.len();
20884 let mut payload_buf = [0; Self::ENCODED_LEN];
20885 let mut buf = if avail_len < Self::ENCODED_LEN {
20886 payload_buf[0..avail_len].copy_from_slice(__input);
20887 Bytes::new(&payload_buf)
20888 } else {
20889 Bytes::new(__input)
20890 };
20891 let mut __struct = Self::default();
20892 __struct.nav_roll = buf.get_f32_le();
20893 __struct.nav_pitch = buf.get_f32_le();
20894 __struct.alt_error = buf.get_f32_le();
20895 __struct.aspd_error = buf.get_f32_le();
20896 __struct.xtrack_error = buf.get_f32_le();
20897 __struct.nav_bearing = buf.get_i16_le();
20898 __struct.target_bearing = buf.get_i16_le();
20899 __struct.wp_dist = buf.get_u16_le();
20900 Ok(__struct)
20901 }
20902 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20903 let mut __tmp = BytesMut::new(bytes);
20904 #[allow(clippy::absurd_extreme_comparisons)]
20905 #[allow(unused_comparisons)]
20906 if __tmp.remaining() < Self::ENCODED_LEN {
20907 panic!(
20908 "buffer is too small (need {} bytes, but got {})",
20909 Self::ENCODED_LEN,
20910 __tmp.remaining(),
20911 )
20912 }
20913 __tmp.put_f32_le(self.nav_roll);
20914 __tmp.put_f32_le(self.nav_pitch);
20915 __tmp.put_f32_le(self.alt_error);
20916 __tmp.put_f32_le(self.aspd_error);
20917 __tmp.put_f32_le(self.xtrack_error);
20918 __tmp.put_i16_le(self.nav_bearing);
20919 __tmp.put_i16_le(self.target_bearing);
20920 __tmp.put_u16_le(self.wp_dist);
20921 if matches!(version, MavlinkVersion::V2) {
20922 let len = __tmp.len();
20923 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20924 } else {
20925 __tmp.len()
20926 }
20927 }
20928}
20929#[doc = "Accelerometer and Gyro biases from the navigation filter."]
20930#[doc = ""]
20931#[doc = "ID: 220"]
20932#[derive(Debug, Clone, PartialEq)]
20933#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20934#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20935#[cfg_attr(feature = "ts", derive(TS))]
20936#[cfg_attr(feature = "ts", ts(export))]
20937pub struct NAV_FILTER_BIAS_DATA {
20938 #[doc = "Timestamp (microseconds)"]
20939 pub usec: u64,
20940 #[doc = "b_f[0]"]
20941 pub accel_0: f32,
20942 #[doc = "b_f[1]"]
20943 pub accel_1: f32,
20944 #[doc = "b_f[2]"]
20945 pub accel_2: f32,
20946 #[doc = "b_f[0]"]
20947 pub gyro_0: f32,
20948 #[doc = "b_f[1]"]
20949 pub gyro_1: f32,
20950 #[doc = "b_f[2]"]
20951 pub gyro_2: f32,
20952}
20953impl NAV_FILTER_BIAS_DATA {
20954 pub const ENCODED_LEN: usize = 32usize;
20955 pub const DEFAULT: Self = Self {
20956 usec: 0_u64,
20957 accel_0: 0.0_f32,
20958 accel_1: 0.0_f32,
20959 accel_2: 0.0_f32,
20960 gyro_0: 0.0_f32,
20961 gyro_1: 0.0_f32,
20962 gyro_2: 0.0_f32,
20963 };
20964 #[cfg(feature = "arbitrary")]
20965 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20966 use arbitrary::{Arbitrary, Unstructured};
20967 let mut buf = [0u8; 1024];
20968 rng.fill_bytes(&mut buf);
20969 let mut unstructured = Unstructured::new(&buf);
20970 Self::arbitrary(&mut unstructured).unwrap_or_default()
20971 }
20972}
20973impl Default for NAV_FILTER_BIAS_DATA {
20974 fn default() -> Self {
20975 Self::DEFAULT.clone()
20976 }
20977}
20978impl MessageData for NAV_FILTER_BIAS_DATA {
20979 type Message = MavMessage;
20980 const ID: u32 = 220u32;
20981 const NAME: &'static str = "NAV_FILTER_BIAS";
20982 const EXTRA_CRC: u8 = 34u8;
20983 const ENCODED_LEN: usize = 32usize;
20984 fn deser(
20985 _version: MavlinkVersion,
20986 __input: &[u8],
20987 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20988 let avail_len = __input.len();
20989 let mut payload_buf = [0; Self::ENCODED_LEN];
20990 let mut buf = if avail_len < Self::ENCODED_LEN {
20991 payload_buf[0..avail_len].copy_from_slice(__input);
20992 Bytes::new(&payload_buf)
20993 } else {
20994 Bytes::new(__input)
20995 };
20996 let mut __struct = Self::default();
20997 __struct.usec = buf.get_u64_le();
20998 __struct.accel_0 = buf.get_f32_le();
20999 __struct.accel_1 = buf.get_f32_le();
21000 __struct.accel_2 = buf.get_f32_le();
21001 __struct.gyro_0 = buf.get_f32_le();
21002 __struct.gyro_1 = buf.get_f32_le();
21003 __struct.gyro_2 = buf.get_f32_le();
21004 Ok(__struct)
21005 }
21006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21007 let mut __tmp = BytesMut::new(bytes);
21008 #[allow(clippy::absurd_extreme_comparisons)]
21009 #[allow(unused_comparisons)]
21010 if __tmp.remaining() < Self::ENCODED_LEN {
21011 panic!(
21012 "buffer is too small (need {} bytes, but got {})",
21013 Self::ENCODED_LEN,
21014 __tmp.remaining(),
21015 )
21016 }
21017 __tmp.put_u64_le(self.usec);
21018 __tmp.put_f32_le(self.accel_0);
21019 __tmp.put_f32_le(self.accel_1);
21020 __tmp.put_f32_le(self.accel_2);
21021 __tmp.put_f32_le(self.gyro_0);
21022 __tmp.put_f32_le(self.gyro_1);
21023 __tmp.put_f32_le(self.gyro_2);
21024 if matches!(version, MavlinkVersion::V2) {
21025 let len = __tmp.len();
21026 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21027 } else {
21028 __tmp.len()
21029 }
21030 }
21031}
21032#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
21033#[doc = ""]
21034#[doc = "ID: 330"]
21035#[derive(Debug, Clone, PartialEq)]
21036#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21037#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21038#[cfg_attr(feature = "ts", derive(TS))]
21039#[cfg_attr(feature = "ts", ts(export))]
21040pub struct OBSTACLE_DISTANCE_DATA {
21041 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21042 pub time_usec: u64,
21043 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
21044 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21045 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21046 pub distances: [u16; 72],
21047 #[doc = "Minimum distance the sensor can measure."]
21048 pub min_distance: u16,
21049 #[doc = "Maximum distance the sensor can measure."]
21050 pub max_distance: u16,
21051 #[doc = "Class id of the distance sensor type."]
21052 pub sensor_type: MavDistanceSensor,
21053 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
21054 pub increment: u8,
21055 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
21056 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21057 pub increment_f: f32,
21058 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
21059 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21060 pub angle_offset: f32,
21061 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
21062 #[cfg_attr(feature = "serde", serde(default))]
21063 pub frame: MavFrame,
21064}
21065impl OBSTACLE_DISTANCE_DATA {
21066 pub const ENCODED_LEN: usize = 167usize;
21067 pub const DEFAULT: Self = Self {
21068 time_usec: 0_u64,
21069 distances: [0_u16; 72usize],
21070 min_distance: 0_u16,
21071 max_distance: 0_u16,
21072 sensor_type: MavDistanceSensor::DEFAULT,
21073 increment: 0_u8,
21074 increment_f: 0.0_f32,
21075 angle_offset: 0.0_f32,
21076 frame: MavFrame::DEFAULT,
21077 };
21078 #[cfg(feature = "arbitrary")]
21079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21080 use arbitrary::{Arbitrary, Unstructured};
21081 let mut buf = [0u8; 1024];
21082 rng.fill_bytes(&mut buf);
21083 let mut unstructured = Unstructured::new(&buf);
21084 Self::arbitrary(&mut unstructured).unwrap_or_default()
21085 }
21086}
21087impl Default for OBSTACLE_DISTANCE_DATA {
21088 fn default() -> Self {
21089 Self::DEFAULT.clone()
21090 }
21091}
21092impl MessageData for OBSTACLE_DISTANCE_DATA {
21093 type Message = MavMessage;
21094 const ID: u32 = 330u32;
21095 const NAME: &'static str = "OBSTACLE_DISTANCE";
21096 const EXTRA_CRC: u8 = 23u8;
21097 const ENCODED_LEN: usize = 167usize;
21098 fn deser(
21099 _version: MavlinkVersion,
21100 __input: &[u8],
21101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21102 let avail_len = __input.len();
21103 let mut payload_buf = [0; Self::ENCODED_LEN];
21104 let mut buf = if avail_len < Self::ENCODED_LEN {
21105 payload_buf[0..avail_len].copy_from_slice(__input);
21106 Bytes::new(&payload_buf)
21107 } else {
21108 Bytes::new(__input)
21109 };
21110 let mut __struct = Self::default();
21111 __struct.time_usec = buf.get_u64_le();
21112 for v in &mut __struct.distances {
21113 let val = buf.get_u16_le();
21114 *v = val;
21115 }
21116 __struct.min_distance = buf.get_u16_le();
21117 __struct.max_distance = buf.get_u16_le();
21118 let tmp = buf.get_u8();
21119 __struct.sensor_type =
21120 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21121 enum_type: "MavDistanceSensor",
21122 value: tmp as u64,
21123 })?;
21124 __struct.increment = buf.get_u8();
21125 __struct.increment_f = buf.get_f32_le();
21126 __struct.angle_offset = buf.get_f32_le();
21127 let tmp = buf.get_u8();
21128 __struct.frame =
21129 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21130 enum_type: "MavFrame",
21131 value: tmp as u64,
21132 })?;
21133 Ok(__struct)
21134 }
21135 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21136 let mut __tmp = BytesMut::new(bytes);
21137 #[allow(clippy::absurd_extreme_comparisons)]
21138 #[allow(unused_comparisons)]
21139 if __tmp.remaining() < Self::ENCODED_LEN {
21140 panic!(
21141 "buffer is too small (need {} bytes, but got {})",
21142 Self::ENCODED_LEN,
21143 __tmp.remaining(),
21144 )
21145 }
21146 __tmp.put_u64_le(self.time_usec);
21147 for val in &self.distances {
21148 __tmp.put_u16_le(*val);
21149 }
21150 __tmp.put_u16_le(self.min_distance);
21151 __tmp.put_u16_le(self.max_distance);
21152 __tmp.put_u8(self.sensor_type as u8);
21153 __tmp.put_u8(self.increment);
21154 if matches!(version, MavlinkVersion::V2) {
21155 __tmp.put_f32_le(self.increment_f);
21156 __tmp.put_f32_le(self.angle_offset);
21157 __tmp.put_u8(self.frame as u8);
21158 let len = __tmp.len();
21159 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21160 } else {
21161 __tmp.len()
21162 }
21163 }
21164}
21165#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
21166#[doc = ""]
21167#[doc = "ID: 331"]
21168#[derive(Debug, Clone, PartialEq)]
21169#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21170#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21171#[cfg_attr(feature = "ts", derive(TS))]
21172#[cfg_attr(feature = "ts", ts(export))]
21173pub struct ODOMETRY_DATA {
21174 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21175 pub time_usec: u64,
21176 #[doc = "X Position"]
21177 pub x: f32,
21178 #[doc = "Y Position"]
21179 pub y: f32,
21180 #[doc = "Z Position"]
21181 pub z: f32,
21182 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21183 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21184 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21185 pub q: [f32; 4],
21186 #[doc = "X linear speed"]
21187 pub vx: f32,
21188 #[doc = "Y linear speed"]
21189 pub vy: f32,
21190 #[doc = "Z linear speed"]
21191 pub vz: f32,
21192 #[doc = "Roll angular speed"]
21193 pub rollspeed: f32,
21194 #[doc = "Pitch angular speed"]
21195 pub pitchspeed: f32,
21196 #[doc = "Yaw angular speed"]
21197 pub yawspeed: f32,
21198 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21199 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21200 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21201 pub pose_covariance: [f32; 21],
21202 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21203 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21204 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21205 pub velocity_covariance: [f32; 21],
21206 #[doc = "Coordinate frame of reference for the pose data."]
21207 pub frame_id: MavFrame,
21208 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
21209 pub child_frame_id: MavFrame,
21210 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
21211 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21212 pub reset_counter: u8,
21213 #[doc = "Type of estimator that is providing the odometry."]
21214 #[cfg_attr(feature = "serde", serde(default))]
21215 pub estimator_type: MavEstimatorType,
21216 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
21217 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21218 pub quality: i8,
21219}
21220impl ODOMETRY_DATA {
21221 pub const ENCODED_LEN: usize = 233usize;
21222 pub const DEFAULT: Self = Self {
21223 time_usec: 0_u64,
21224 x: 0.0_f32,
21225 y: 0.0_f32,
21226 z: 0.0_f32,
21227 q: [0.0_f32; 4usize],
21228 vx: 0.0_f32,
21229 vy: 0.0_f32,
21230 vz: 0.0_f32,
21231 rollspeed: 0.0_f32,
21232 pitchspeed: 0.0_f32,
21233 yawspeed: 0.0_f32,
21234 pose_covariance: [0.0_f32; 21usize],
21235 velocity_covariance: [0.0_f32; 21usize],
21236 frame_id: MavFrame::DEFAULT,
21237 child_frame_id: MavFrame::DEFAULT,
21238 reset_counter: 0_u8,
21239 estimator_type: MavEstimatorType::DEFAULT,
21240 quality: 0_i8,
21241 };
21242 #[cfg(feature = "arbitrary")]
21243 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21244 use arbitrary::{Arbitrary, Unstructured};
21245 let mut buf = [0u8; 1024];
21246 rng.fill_bytes(&mut buf);
21247 let mut unstructured = Unstructured::new(&buf);
21248 Self::arbitrary(&mut unstructured).unwrap_or_default()
21249 }
21250}
21251impl Default for ODOMETRY_DATA {
21252 fn default() -> Self {
21253 Self::DEFAULT.clone()
21254 }
21255}
21256impl MessageData for ODOMETRY_DATA {
21257 type Message = MavMessage;
21258 const ID: u32 = 331u32;
21259 const NAME: &'static str = "ODOMETRY";
21260 const EXTRA_CRC: u8 = 91u8;
21261 const ENCODED_LEN: usize = 233usize;
21262 fn deser(
21263 _version: MavlinkVersion,
21264 __input: &[u8],
21265 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21266 let avail_len = __input.len();
21267 let mut payload_buf = [0; Self::ENCODED_LEN];
21268 let mut buf = if avail_len < Self::ENCODED_LEN {
21269 payload_buf[0..avail_len].copy_from_slice(__input);
21270 Bytes::new(&payload_buf)
21271 } else {
21272 Bytes::new(__input)
21273 };
21274 let mut __struct = Self::default();
21275 __struct.time_usec = buf.get_u64_le();
21276 __struct.x = buf.get_f32_le();
21277 __struct.y = buf.get_f32_le();
21278 __struct.z = buf.get_f32_le();
21279 for v in &mut __struct.q {
21280 let val = buf.get_f32_le();
21281 *v = val;
21282 }
21283 __struct.vx = buf.get_f32_le();
21284 __struct.vy = buf.get_f32_le();
21285 __struct.vz = buf.get_f32_le();
21286 __struct.rollspeed = buf.get_f32_le();
21287 __struct.pitchspeed = buf.get_f32_le();
21288 __struct.yawspeed = buf.get_f32_le();
21289 for v in &mut __struct.pose_covariance {
21290 let val = buf.get_f32_le();
21291 *v = val;
21292 }
21293 for v in &mut __struct.velocity_covariance {
21294 let val = buf.get_f32_le();
21295 *v = val;
21296 }
21297 let tmp = buf.get_u8();
21298 __struct.frame_id =
21299 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21300 enum_type: "MavFrame",
21301 value: tmp as u64,
21302 })?;
21303 let tmp = buf.get_u8();
21304 __struct.child_frame_id =
21305 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21306 enum_type: "MavFrame",
21307 value: tmp as u64,
21308 })?;
21309 __struct.reset_counter = buf.get_u8();
21310 let tmp = buf.get_u8();
21311 __struct.estimator_type =
21312 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21313 enum_type: "MavEstimatorType",
21314 value: tmp as u64,
21315 })?;
21316 __struct.quality = buf.get_i8();
21317 Ok(__struct)
21318 }
21319 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21320 let mut __tmp = BytesMut::new(bytes);
21321 #[allow(clippy::absurd_extreme_comparisons)]
21322 #[allow(unused_comparisons)]
21323 if __tmp.remaining() < Self::ENCODED_LEN {
21324 panic!(
21325 "buffer is too small (need {} bytes, but got {})",
21326 Self::ENCODED_LEN,
21327 __tmp.remaining(),
21328 )
21329 }
21330 __tmp.put_u64_le(self.time_usec);
21331 __tmp.put_f32_le(self.x);
21332 __tmp.put_f32_le(self.y);
21333 __tmp.put_f32_le(self.z);
21334 for val in &self.q {
21335 __tmp.put_f32_le(*val);
21336 }
21337 __tmp.put_f32_le(self.vx);
21338 __tmp.put_f32_le(self.vy);
21339 __tmp.put_f32_le(self.vz);
21340 __tmp.put_f32_le(self.rollspeed);
21341 __tmp.put_f32_le(self.pitchspeed);
21342 __tmp.put_f32_le(self.yawspeed);
21343 for val in &self.pose_covariance {
21344 __tmp.put_f32_le(*val);
21345 }
21346 for val in &self.velocity_covariance {
21347 __tmp.put_f32_le(*val);
21348 }
21349 __tmp.put_u8(self.frame_id as u8);
21350 __tmp.put_u8(self.child_frame_id as u8);
21351 if matches!(version, MavlinkVersion::V2) {
21352 __tmp.put_u8(self.reset_counter);
21353 __tmp.put_u8(self.estimator_type as u8);
21354 __tmp.put_i8(self.quality);
21355 let len = __tmp.len();
21356 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21357 } else {
21358 __tmp.len()
21359 }
21360 }
21361}
21362#[doc = "Hardware status sent by an onboard computer."]
21363#[doc = ""]
21364#[doc = "ID: 390"]
21365#[derive(Debug, Clone, PartialEq)]
21366#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21368#[cfg_attr(feature = "ts", derive(TS))]
21369#[cfg_attr(feature = "ts", ts(export))]
21370pub struct ONBOARD_COMPUTER_STATUS_DATA {
21371 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21372 pub time_usec: u64,
21373 #[doc = "Time since system boot."]
21374 pub uptime: u32,
21375 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21376 pub ram_usage: u32,
21377 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21378 pub ram_total: u32,
21379 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
21380 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21381 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21382 pub storage_type: [u32; 4],
21383 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21384 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21385 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21386 pub storage_usage: [u32; 4],
21387 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21388 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21389 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21390 pub storage_total: [u32; 4],
21391 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
21392 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21393 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21394 pub link_type: [u32; 6],
21395 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
21396 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21397 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21398 pub link_tx_rate: [u32; 6],
21399 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
21400 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21401 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21402 pub link_rx_rate: [u32; 6],
21403 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
21404 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21405 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21406 pub link_tx_max: [u32; 6],
21407 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
21408 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21409 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21410 pub link_rx_max: [u32; 6],
21411 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
21412 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21413 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21414 pub fan_speed: [i16; 4],
21415 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
21416 pub mavtype: u8,
21417 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21418 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21419 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21420 pub cpu_cores: [u8; 8],
21421 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21422 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21423 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21424 pub cpu_combined: [u8; 10],
21425 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21426 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21427 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21428 pub gpu_cores: [u8; 4],
21429 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21430 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21431 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21432 pub gpu_combined: [u8; 10],
21433 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
21434 pub temperature_board: i8,
21435 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
21436 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21437 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21438 pub temperature_core: [i8; 8],
21439}
21440impl ONBOARD_COMPUTER_STATUS_DATA {
21441 pub const ENCODED_LEN: usize = 238usize;
21442 pub const DEFAULT: Self = Self {
21443 time_usec: 0_u64,
21444 uptime: 0_u32,
21445 ram_usage: 0_u32,
21446 ram_total: 0_u32,
21447 storage_type: [0_u32; 4usize],
21448 storage_usage: [0_u32; 4usize],
21449 storage_total: [0_u32; 4usize],
21450 link_type: [0_u32; 6usize],
21451 link_tx_rate: [0_u32; 6usize],
21452 link_rx_rate: [0_u32; 6usize],
21453 link_tx_max: [0_u32; 6usize],
21454 link_rx_max: [0_u32; 6usize],
21455 fan_speed: [0_i16; 4usize],
21456 mavtype: 0_u8,
21457 cpu_cores: [0_u8; 8usize],
21458 cpu_combined: [0_u8; 10usize],
21459 gpu_cores: [0_u8; 4usize],
21460 gpu_combined: [0_u8; 10usize],
21461 temperature_board: 0_i8,
21462 temperature_core: [0_i8; 8usize],
21463 };
21464 #[cfg(feature = "arbitrary")]
21465 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21466 use arbitrary::{Arbitrary, Unstructured};
21467 let mut buf = [0u8; 1024];
21468 rng.fill_bytes(&mut buf);
21469 let mut unstructured = Unstructured::new(&buf);
21470 Self::arbitrary(&mut unstructured).unwrap_or_default()
21471 }
21472}
21473impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21474 fn default() -> Self {
21475 Self::DEFAULT.clone()
21476 }
21477}
21478impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21479 type Message = MavMessage;
21480 const ID: u32 = 390u32;
21481 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21482 const EXTRA_CRC: u8 = 156u8;
21483 const ENCODED_LEN: usize = 238usize;
21484 fn deser(
21485 _version: MavlinkVersion,
21486 __input: &[u8],
21487 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21488 let avail_len = __input.len();
21489 let mut payload_buf = [0; Self::ENCODED_LEN];
21490 let mut buf = if avail_len < Self::ENCODED_LEN {
21491 payload_buf[0..avail_len].copy_from_slice(__input);
21492 Bytes::new(&payload_buf)
21493 } else {
21494 Bytes::new(__input)
21495 };
21496 let mut __struct = Self::default();
21497 __struct.time_usec = buf.get_u64_le();
21498 __struct.uptime = buf.get_u32_le();
21499 __struct.ram_usage = buf.get_u32_le();
21500 __struct.ram_total = buf.get_u32_le();
21501 for v in &mut __struct.storage_type {
21502 let val = buf.get_u32_le();
21503 *v = val;
21504 }
21505 for v in &mut __struct.storage_usage {
21506 let val = buf.get_u32_le();
21507 *v = val;
21508 }
21509 for v in &mut __struct.storage_total {
21510 let val = buf.get_u32_le();
21511 *v = val;
21512 }
21513 for v in &mut __struct.link_type {
21514 let val = buf.get_u32_le();
21515 *v = val;
21516 }
21517 for v in &mut __struct.link_tx_rate {
21518 let val = buf.get_u32_le();
21519 *v = val;
21520 }
21521 for v in &mut __struct.link_rx_rate {
21522 let val = buf.get_u32_le();
21523 *v = val;
21524 }
21525 for v in &mut __struct.link_tx_max {
21526 let val = buf.get_u32_le();
21527 *v = val;
21528 }
21529 for v in &mut __struct.link_rx_max {
21530 let val = buf.get_u32_le();
21531 *v = val;
21532 }
21533 for v in &mut __struct.fan_speed {
21534 let val = buf.get_i16_le();
21535 *v = val;
21536 }
21537 __struct.mavtype = buf.get_u8();
21538 for v in &mut __struct.cpu_cores {
21539 let val = buf.get_u8();
21540 *v = val;
21541 }
21542 for v in &mut __struct.cpu_combined {
21543 let val = buf.get_u8();
21544 *v = val;
21545 }
21546 for v in &mut __struct.gpu_cores {
21547 let val = buf.get_u8();
21548 *v = val;
21549 }
21550 for v in &mut __struct.gpu_combined {
21551 let val = buf.get_u8();
21552 *v = val;
21553 }
21554 __struct.temperature_board = buf.get_i8();
21555 for v in &mut __struct.temperature_core {
21556 let val = buf.get_i8();
21557 *v = val;
21558 }
21559 Ok(__struct)
21560 }
21561 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21562 let mut __tmp = BytesMut::new(bytes);
21563 #[allow(clippy::absurd_extreme_comparisons)]
21564 #[allow(unused_comparisons)]
21565 if __tmp.remaining() < Self::ENCODED_LEN {
21566 panic!(
21567 "buffer is too small (need {} bytes, but got {})",
21568 Self::ENCODED_LEN,
21569 __tmp.remaining(),
21570 )
21571 }
21572 __tmp.put_u64_le(self.time_usec);
21573 __tmp.put_u32_le(self.uptime);
21574 __tmp.put_u32_le(self.ram_usage);
21575 __tmp.put_u32_le(self.ram_total);
21576 for val in &self.storage_type {
21577 __tmp.put_u32_le(*val);
21578 }
21579 for val in &self.storage_usage {
21580 __tmp.put_u32_le(*val);
21581 }
21582 for val in &self.storage_total {
21583 __tmp.put_u32_le(*val);
21584 }
21585 for val in &self.link_type {
21586 __tmp.put_u32_le(*val);
21587 }
21588 for val in &self.link_tx_rate {
21589 __tmp.put_u32_le(*val);
21590 }
21591 for val in &self.link_rx_rate {
21592 __tmp.put_u32_le(*val);
21593 }
21594 for val in &self.link_tx_max {
21595 __tmp.put_u32_le(*val);
21596 }
21597 for val in &self.link_rx_max {
21598 __tmp.put_u32_le(*val);
21599 }
21600 for val in &self.fan_speed {
21601 __tmp.put_i16_le(*val);
21602 }
21603 __tmp.put_u8(self.mavtype);
21604 for val in &self.cpu_cores {
21605 __tmp.put_u8(*val);
21606 }
21607 for val in &self.cpu_combined {
21608 __tmp.put_u8(*val);
21609 }
21610 for val in &self.gpu_cores {
21611 __tmp.put_u8(*val);
21612 }
21613 for val in &self.gpu_combined {
21614 __tmp.put_u8(*val);
21615 }
21616 __tmp.put_i8(self.temperature_board);
21617 for val in &self.temperature_core {
21618 __tmp.put_i8(*val);
21619 }
21620 if matches!(version, MavlinkVersion::V2) {
21621 let len = __tmp.len();
21622 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21623 } else {
21624 __tmp.len()
21625 }
21626 }
21627}
21628#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21629#[doc = ""]
21630#[doc = "ID: 12918"]
21631#[derive(Debug, Clone, PartialEq)]
21632#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21633#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21634#[cfg_attr(feature = "ts", derive(TS))]
21635#[cfg_attr(feature = "ts", ts(export))]
21636pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21637 #[doc = "Status level indicating if arming is allowed."]
21638 pub status: MavOdidArmStatus,
21639 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21640 #[cfg_attr(feature = "ts", ts(type = "string"))]
21641 pub error: CharArray<50>,
21642}
21643impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21644 pub const ENCODED_LEN: usize = 51usize;
21645 pub const DEFAULT: Self = Self {
21646 status: MavOdidArmStatus::DEFAULT,
21647 error: CharArray::new([0_u8; 50usize]),
21648 };
21649 #[cfg(feature = "arbitrary")]
21650 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21651 use arbitrary::{Arbitrary, Unstructured};
21652 let mut buf = [0u8; 1024];
21653 rng.fill_bytes(&mut buf);
21654 let mut unstructured = Unstructured::new(&buf);
21655 Self::arbitrary(&mut unstructured).unwrap_or_default()
21656 }
21657}
21658impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21659 fn default() -> Self {
21660 Self::DEFAULT.clone()
21661 }
21662}
21663impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21664 type Message = MavMessage;
21665 const ID: u32 = 12918u32;
21666 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21667 const EXTRA_CRC: u8 = 139u8;
21668 const ENCODED_LEN: usize = 51usize;
21669 fn deser(
21670 _version: MavlinkVersion,
21671 __input: &[u8],
21672 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21673 let avail_len = __input.len();
21674 let mut payload_buf = [0; Self::ENCODED_LEN];
21675 let mut buf = if avail_len < Self::ENCODED_LEN {
21676 payload_buf[0..avail_len].copy_from_slice(__input);
21677 Bytes::new(&payload_buf)
21678 } else {
21679 Bytes::new(__input)
21680 };
21681 let mut __struct = Self::default();
21682 let tmp = buf.get_u8();
21683 __struct.status =
21684 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21685 enum_type: "MavOdidArmStatus",
21686 value: tmp as u64,
21687 })?;
21688 let mut tmp = [0_u8; 50usize];
21689 for v in &mut tmp {
21690 *v = buf.get_u8();
21691 }
21692 __struct.error = CharArray::new(tmp);
21693 Ok(__struct)
21694 }
21695 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21696 let mut __tmp = BytesMut::new(bytes);
21697 #[allow(clippy::absurd_extreme_comparisons)]
21698 #[allow(unused_comparisons)]
21699 if __tmp.remaining() < Self::ENCODED_LEN {
21700 panic!(
21701 "buffer is too small (need {} bytes, but got {})",
21702 Self::ENCODED_LEN,
21703 __tmp.remaining(),
21704 )
21705 }
21706 __tmp.put_u8(self.status as u8);
21707 for val in &self.error {
21708 __tmp.put_u8(*val);
21709 }
21710 if matches!(version, MavlinkVersion::V2) {
21711 let len = __tmp.len();
21712 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21713 } else {
21714 __tmp.len()
21715 }
21716 }
21717}
21718#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
21719#[doc = ""]
21720#[doc = "ID: 12902"]
21721#[derive(Debug, Clone, PartialEq)]
21722#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21723#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21724#[cfg_attr(feature = "ts", derive(TS))]
21725#[cfg_attr(feature = "ts", ts(export))]
21726pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
21727 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21728 pub timestamp: u32,
21729 #[doc = "System ID (0 for broadcast)."]
21730 pub target_system: u8,
21731 #[doc = "Component ID (0 for broadcast)."]
21732 pub target_component: u8,
21733 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21734 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21735 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21736 pub id_or_mac: [u8; 20],
21737 #[doc = "Indicates the type of authentication."]
21738 pub authentication_type: MavOdidAuthType,
21739 #[doc = "Allowed range is 0 - 15."]
21740 pub data_page: u8,
21741 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21742 pub last_page_index: u8,
21743 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21744 pub length: u8,
21745 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
21746 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21747 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21748 pub authentication_data: [u8; 23],
21749}
21750impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
21751 pub const ENCODED_LEN: usize = 53usize;
21752 pub const DEFAULT: Self = Self {
21753 timestamp: 0_u32,
21754 target_system: 0_u8,
21755 target_component: 0_u8,
21756 id_or_mac: [0_u8; 20usize],
21757 authentication_type: MavOdidAuthType::DEFAULT,
21758 data_page: 0_u8,
21759 last_page_index: 0_u8,
21760 length: 0_u8,
21761 authentication_data: [0_u8; 23usize],
21762 };
21763 #[cfg(feature = "arbitrary")]
21764 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21765 use arbitrary::{Arbitrary, Unstructured};
21766 let mut buf = [0u8; 1024];
21767 rng.fill_bytes(&mut buf);
21768 let mut unstructured = Unstructured::new(&buf);
21769 Self::arbitrary(&mut unstructured).unwrap_or_default()
21770 }
21771}
21772impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21773 fn default() -> Self {
21774 Self::DEFAULT.clone()
21775 }
21776}
21777impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21778 type Message = MavMessage;
21779 const ID: u32 = 12902u32;
21780 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
21781 const EXTRA_CRC: u8 = 140u8;
21782 const ENCODED_LEN: usize = 53usize;
21783 fn deser(
21784 _version: MavlinkVersion,
21785 __input: &[u8],
21786 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21787 let avail_len = __input.len();
21788 let mut payload_buf = [0; Self::ENCODED_LEN];
21789 let mut buf = if avail_len < Self::ENCODED_LEN {
21790 payload_buf[0..avail_len].copy_from_slice(__input);
21791 Bytes::new(&payload_buf)
21792 } else {
21793 Bytes::new(__input)
21794 };
21795 let mut __struct = Self::default();
21796 __struct.timestamp = buf.get_u32_le();
21797 __struct.target_system = buf.get_u8();
21798 __struct.target_component = buf.get_u8();
21799 for v in &mut __struct.id_or_mac {
21800 let val = buf.get_u8();
21801 *v = val;
21802 }
21803 let tmp = buf.get_u8();
21804 __struct.authentication_type =
21805 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21806 enum_type: "MavOdidAuthType",
21807 value: tmp as u64,
21808 })?;
21809 __struct.data_page = buf.get_u8();
21810 __struct.last_page_index = buf.get_u8();
21811 __struct.length = buf.get_u8();
21812 for v in &mut __struct.authentication_data {
21813 let val = buf.get_u8();
21814 *v = val;
21815 }
21816 Ok(__struct)
21817 }
21818 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21819 let mut __tmp = BytesMut::new(bytes);
21820 #[allow(clippy::absurd_extreme_comparisons)]
21821 #[allow(unused_comparisons)]
21822 if __tmp.remaining() < Self::ENCODED_LEN {
21823 panic!(
21824 "buffer is too small (need {} bytes, but got {})",
21825 Self::ENCODED_LEN,
21826 __tmp.remaining(),
21827 )
21828 }
21829 __tmp.put_u32_le(self.timestamp);
21830 __tmp.put_u8(self.target_system);
21831 __tmp.put_u8(self.target_component);
21832 for val in &self.id_or_mac {
21833 __tmp.put_u8(*val);
21834 }
21835 __tmp.put_u8(self.authentication_type as u8);
21836 __tmp.put_u8(self.data_page);
21837 __tmp.put_u8(self.last_page_index);
21838 __tmp.put_u8(self.length);
21839 for val in &self.authentication_data {
21840 __tmp.put_u8(*val);
21841 }
21842 if matches!(version, MavlinkVersion::V2) {
21843 let len = __tmp.len();
21844 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21845 } else {
21846 __tmp.len()
21847 }
21848 }
21849}
21850#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
21851#[doc = ""]
21852#[doc = "ID: 12900"]
21853#[derive(Debug, Clone, PartialEq)]
21854#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21855#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21856#[cfg_attr(feature = "ts", derive(TS))]
21857#[cfg_attr(feature = "ts", ts(export))]
21858pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
21859 #[doc = "System ID (0 for broadcast)."]
21860 pub target_system: u8,
21861 #[doc = "Component ID (0 for broadcast)."]
21862 pub target_component: u8,
21863 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21864 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21865 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21866 pub id_or_mac: [u8; 20],
21867 #[doc = "Indicates the format for the uas_id field of this message."]
21868 pub id_type: MavOdidIdType,
21869 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
21870 pub ua_type: MavOdidUaType,
21871 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
21872 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21873 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21874 pub uas_id: [u8; 20],
21875}
21876impl OPEN_DRONE_ID_BASIC_ID_DATA {
21877 pub const ENCODED_LEN: usize = 44usize;
21878 pub const DEFAULT: Self = Self {
21879 target_system: 0_u8,
21880 target_component: 0_u8,
21881 id_or_mac: [0_u8; 20usize],
21882 id_type: MavOdidIdType::DEFAULT,
21883 ua_type: MavOdidUaType::DEFAULT,
21884 uas_id: [0_u8; 20usize],
21885 };
21886 #[cfg(feature = "arbitrary")]
21887 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21888 use arbitrary::{Arbitrary, Unstructured};
21889 let mut buf = [0u8; 1024];
21890 rng.fill_bytes(&mut buf);
21891 let mut unstructured = Unstructured::new(&buf);
21892 Self::arbitrary(&mut unstructured).unwrap_or_default()
21893 }
21894}
21895impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
21896 fn default() -> Self {
21897 Self::DEFAULT.clone()
21898 }
21899}
21900impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
21901 type Message = MavMessage;
21902 const ID: u32 = 12900u32;
21903 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
21904 const EXTRA_CRC: u8 = 114u8;
21905 const ENCODED_LEN: usize = 44usize;
21906 fn deser(
21907 _version: MavlinkVersion,
21908 __input: &[u8],
21909 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21910 let avail_len = __input.len();
21911 let mut payload_buf = [0; Self::ENCODED_LEN];
21912 let mut buf = if avail_len < Self::ENCODED_LEN {
21913 payload_buf[0..avail_len].copy_from_slice(__input);
21914 Bytes::new(&payload_buf)
21915 } else {
21916 Bytes::new(__input)
21917 };
21918 let mut __struct = Self::default();
21919 __struct.target_system = buf.get_u8();
21920 __struct.target_component = buf.get_u8();
21921 for v in &mut __struct.id_or_mac {
21922 let val = buf.get_u8();
21923 *v = val;
21924 }
21925 let tmp = buf.get_u8();
21926 __struct.id_type =
21927 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21928 enum_type: "MavOdidIdType",
21929 value: tmp as u64,
21930 })?;
21931 let tmp = buf.get_u8();
21932 __struct.ua_type =
21933 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21934 enum_type: "MavOdidUaType",
21935 value: tmp as u64,
21936 })?;
21937 for v in &mut __struct.uas_id {
21938 let val = buf.get_u8();
21939 *v = val;
21940 }
21941 Ok(__struct)
21942 }
21943 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21944 let mut __tmp = BytesMut::new(bytes);
21945 #[allow(clippy::absurd_extreme_comparisons)]
21946 #[allow(unused_comparisons)]
21947 if __tmp.remaining() < Self::ENCODED_LEN {
21948 panic!(
21949 "buffer is too small (need {} bytes, but got {})",
21950 Self::ENCODED_LEN,
21951 __tmp.remaining(),
21952 )
21953 }
21954 __tmp.put_u8(self.target_system);
21955 __tmp.put_u8(self.target_component);
21956 for val in &self.id_or_mac {
21957 __tmp.put_u8(*val);
21958 }
21959 __tmp.put_u8(self.id_type as u8);
21960 __tmp.put_u8(self.ua_type as u8);
21961 for val in &self.uas_id {
21962 __tmp.put_u8(*val);
21963 }
21964 if matches!(version, MavlinkVersion::V2) {
21965 let len = __tmp.len();
21966 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21967 } else {
21968 __tmp.len()
21969 }
21970 }
21971}
21972#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
21973#[doc = ""]
21974#[doc = "ID: 12901"]
21975#[derive(Debug, Clone, PartialEq)]
21976#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21977#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21978#[cfg_attr(feature = "ts", derive(TS))]
21979#[cfg_attr(feature = "ts", ts(export))]
21980pub struct OPEN_DRONE_ID_LOCATION_DATA {
21981 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21982 pub latitude: i32,
21983 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21984 pub longitude: i32,
21985 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
21986 pub altitude_barometric: f32,
21987 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
21988 pub altitude_geodetic: f32,
21989 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
21990 pub height: f32,
21991 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
21992 pub timestamp: f32,
21993 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
21994 pub direction: u16,
21995 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
21996 pub speed_horizontal: u16,
21997 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
21998 pub speed_vertical: i16,
21999 #[doc = "System ID (0 for broadcast)."]
22000 pub target_system: u8,
22001 #[doc = "Component ID (0 for broadcast)."]
22002 pub target_component: u8,
22003 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22004 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22005 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22006 pub id_or_mac: [u8; 20],
22007 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22008 pub status: MavOdidStatus,
22009 #[doc = "Indicates the reference point for the height field."]
22010 pub height_reference: MavOdidHeightRef,
22011 #[doc = "The accuracy of the horizontal position."]
22012 pub horizontal_accuracy: MavOdidHorAcc,
22013 #[doc = "The accuracy of the vertical position."]
22014 pub vertical_accuracy: MavOdidVerAcc,
22015 #[doc = "The accuracy of the barometric altitude."]
22016 pub barometer_accuracy: MavOdidVerAcc,
22017 #[doc = "The accuracy of the horizontal and vertical speed."]
22018 pub speed_accuracy: MavOdidSpeedAcc,
22019 #[doc = "The accuracy of the timestamps."]
22020 pub timestamp_accuracy: MavOdidTimeAcc,
22021}
22022impl OPEN_DRONE_ID_LOCATION_DATA {
22023 pub const ENCODED_LEN: usize = 59usize;
22024 pub const DEFAULT: Self = Self {
22025 latitude: 0_i32,
22026 longitude: 0_i32,
22027 altitude_barometric: 0.0_f32,
22028 altitude_geodetic: 0.0_f32,
22029 height: 0.0_f32,
22030 timestamp: 0.0_f32,
22031 direction: 0_u16,
22032 speed_horizontal: 0_u16,
22033 speed_vertical: 0_i16,
22034 target_system: 0_u8,
22035 target_component: 0_u8,
22036 id_or_mac: [0_u8; 20usize],
22037 status: MavOdidStatus::DEFAULT,
22038 height_reference: MavOdidHeightRef::DEFAULT,
22039 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
22040 vertical_accuracy: MavOdidVerAcc::DEFAULT,
22041 barometer_accuracy: MavOdidVerAcc::DEFAULT,
22042 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
22043 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
22044 };
22045 #[cfg(feature = "arbitrary")]
22046 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22047 use arbitrary::{Arbitrary, Unstructured};
22048 let mut buf = [0u8; 1024];
22049 rng.fill_bytes(&mut buf);
22050 let mut unstructured = Unstructured::new(&buf);
22051 Self::arbitrary(&mut unstructured).unwrap_or_default()
22052 }
22053}
22054impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22055 fn default() -> Self {
22056 Self::DEFAULT.clone()
22057 }
22058}
22059impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22060 type Message = MavMessage;
22061 const ID: u32 = 12901u32;
22062 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22063 const EXTRA_CRC: u8 = 254u8;
22064 const ENCODED_LEN: usize = 59usize;
22065 fn deser(
22066 _version: MavlinkVersion,
22067 __input: &[u8],
22068 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22069 let avail_len = __input.len();
22070 let mut payload_buf = [0; Self::ENCODED_LEN];
22071 let mut buf = if avail_len < Self::ENCODED_LEN {
22072 payload_buf[0..avail_len].copy_from_slice(__input);
22073 Bytes::new(&payload_buf)
22074 } else {
22075 Bytes::new(__input)
22076 };
22077 let mut __struct = Self::default();
22078 __struct.latitude = buf.get_i32_le();
22079 __struct.longitude = buf.get_i32_le();
22080 __struct.altitude_barometric = buf.get_f32_le();
22081 __struct.altitude_geodetic = buf.get_f32_le();
22082 __struct.height = buf.get_f32_le();
22083 __struct.timestamp = buf.get_f32_le();
22084 __struct.direction = buf.get_u16_le();
22085 __struct.speed_horizontal = buf.get_u16_le();
22086 __struct.speed_vertical = buf.get_i16_le();
22087 __struct.target_system = buf.get_u8();
22088 __struct.target_component = buf.get_u8();
22089 for v in &mut __struct.id_or_mac {
22090 let val = buf.get_u8();
22091 *v = val;
22092 }
22093 let tmp = buf.get_u8();
22094 __struct.status =
22095 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22096 enum_type: "MavOdidStatus",
22097 value: tmp as u64,
22098 })?;
22099 let tmp = buf.get_u8();
22100 __struct.height_reference =
22101 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22102 enum_type: "MavOdidHeightRef",
22103 value: tmp as u64,
22104 })?;
22105 let tmp = buf.get_u8();
22106 __struct.horizontal_accuracy =
22107 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22108 enum_type: "MavOdidHorAcc",
22109 value: tmp as u64,
22110 })?;
22111 let tmp = buf.get_u8();
22112 __struct.vertical_accuracy =
22113 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22114 enum_type: "MavOdidVerAcc",
22115 value: tmp as u64,
22116 })?;
22117 let tmp = buf.get_u8();
22118 __struct.barometer_accuracy =
22119 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22120 enum_type: "MavOdidVerAcc",
22121 value: tmp as u64,
22122 })?;
22123 let tmp = buf.get_u8();
22124 __struct.speed_accuracy =
22125 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22126 enum_type: "MavOdidSpeedAcc",
22127 value: tmp as u64,
22128 })?;
22129 let tmp = buf.get_u8();
22130 __struct.timestamp_accuracy =
22131 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22132 enum_type: "MavOdidTimeAcc",
22133 value: tmp as u64,
22134 })?;
22135 Ok(__struct)
22136 }
22137 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22138 let mut __tmp = BytesMut::new(bytes);
22139 #[allow(clippy::absurd_extreme_comparisons)]
22140 #[allow(unused_comparisons)]
22141 if __tmp.remaining() < Self::ENCODED_LEN {
22142 panic!(
22143 "buffer is too small (need {} bytes, but got {})",
22144 Self::ENCODED_LEN,
22145 __tmp.remaining(),
22146 )
22147 }
22148 __tmp.put_i32_le(self.latitude);
22149 __tmp.put_i32_le(self.longitude);
22150 __tmp.put_f32_le(self.altitude_barometric);
22151 __tmp.put_f32_le(self.altitude_geodetic);
22152 __tmp.put_f32_le(self.height);
22153 __tmp.put_f32_le(self.timestamp);
22154 __tmp.put_u16_le(self.direction);
22155 __tmp.put_u16_le(self.speed_horizontal);
22156 __tmp.put_i16_le(self.speed_vertical);
22157 __tmp.put_u8(self.target_system);
22158 __tmp.put_u8(self.target_component);
22159 for val in &self.id_or_mac {
22160 __tmp.put_u8(*val);
22161 }
22162 __tmp.put_u8(self.status as u8);
22163 __tmp.put_u8(self.height_reference as u8);
22164 __tmp.put_u8(self.horizontal_accuracy as u8);
22165 __tmp.put_u8(self.vertical_accuracy as u8);
22166 __tmp.put_u8(self.barometer_accuracy as u8);
22167 __tmp.put_u8(self.speed_accuracy as u8);
22168 __tmp.put_u8(self.timestamp_accuracy as u8);
22169 if matches!(version, MavlinkVersion::V2) {
22170 let len = __tmp.len();
22171 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22172 } else {
22173 __tmp.len()
22174 }
22175 }
22176}
22177#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22178#[doc = ""]
22179#[doc = "ID: 12915"]
22180#[derive(Debug, Clone, PartialEq)]
22181#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22182#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22183#[cfg_attr(feature = "ts", derive(TS))]
22184#[cfg_attr(feature = "ts", ts(export))]
22185pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22186 #[doc = "System ID (0 for broadcast)."]
22187 pub target_system: u8,
22188 #[doc = "Component ID (0 for broadcast)."]
22189 pub target_component: u8,
22190 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22191 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22192 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22193 pub id_or_mac: [u8; 20],
22194 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22195 pub single_message_size: u8,
22196 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22197 pub msg_pack_size: u8,
22198 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22199 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22200 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22201 pub messages: [u8; 225],
22202}
22203impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22204 pub const ENCODED_LEN: usize = 249usize;
22205 pub const DEFAULT: Self = Self {
22206 target_system: 0_u8,
22207 target_component: 0_u8,
22208 id_or_mac: [0_u8; 20usize],
22209 single_message_size: 0_u8,
22210 msg_pack_size: 0_u8,
22211 messages: [0_u8; 225usize],
22212 };
22213 #[cfg(feature = "arbitrary")]
22214 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22215 use arbitrary::{Arbitrary, Unstructured};
22216 let mut buf = [0u8; 1024];
22217 rng.fill_bytes(&mut buf);
22218 let mut unstructured = Unstructured::new(&buf);
22219 Self::arbitrary(&mut unstructured).unwrap_or_default()
22220 }
22221}
22222impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22223 fn default() -> Self {
22224 Self::DEFAULT.clone()
22225 }
22226}
22227impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22228 type Message = MavMessage;
22229 const ID: u32 = 12915u32;
22230 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
22231 const EXTRA_CRC: u8 = 94u8;
22232 const ENCODED_LEN: usize = 249usize;
22233 fn deser(
22234 _version: MavlinkVersion,
22235 __input: &[u8],
22236 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22237 let avail_len = __input.len();
22238 let mut payload_buf = [0; Self::ENCODED_LEN];
22239 let mut buf = if avail_len < Self::ENCODED_LEN {
22240 payload_buf[0..avail_len].copy_from_slice(__input);
22241 Bytes::new(&payload_buf)
22242 } else {
22243 Bytes::new(__input)
22244 };
22245 let mut __struct = Self::default();
22246 __struct.target_system = buf.get_u8();
22247 __struct.target_component = buf.get_u8();
22248 for v in &mut __struct.id_or_mac {
22249 let val = buf.get_u8();
22250 *v = val;
22251 }
22252 __struct.single_message_size = buf.get_u8();
22253 __struct.msg_pack_size = buf.get_u8();
22254 for v in &mut __struct.messages {
22255 let val = buf.get_u8();
22256 *v = val;
22257 }
22258 Ok(__struct)
22259 }
22260 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22261 let mut __tmp = BytesMut::new(bytes);
22262 #[allow(clippy::absurd_extreme_comparisons)]
22263 #[allow(unused_comparisons)]
22264 if __tmp.remaining() < Self::ENCODED_LEN {
22265 panic!(
22266 "buffer is too small (need {} bytes, but got {})",
22267 Self::ENCODED_LEN,
22268 __tmp.remaining(),
22269 )
22270 }
22271 __tmp.put_u8(self.target_system);
22272 __tmp.put_u8(self.target_component);
22273 for val in &self.id_or_mac {
22274 __tmp.put_u8(*val);
22275 }
22276 __tmp.put_u8(self.single_message_size);
22277 __tmp.put_u8(self.msg_pack_size);
22278 for val in &self.messages {
22279 __tmp.put_u8(*val);
22280 }
22281 if matches!(version, MavlinkVersion::V2) {
22282 let len = __tmp.len();
22283 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22284 } else {
22285 __tmp.len()
22286 }
22287 }
22288}
22289#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
22290#[doc = ""]
22291#[doc = "ID: 12905"]
22292#[derive(Debug, Clone, PartialEq)]
22293#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22294#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22295#[cfg_attr(feature = "ts", derive(TS))]
22296#[cfg_attr(feature = "ts", ts(export))]
22297pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
22298 #[doc = "System ID (0 for broadcast)."]
22299 pub target_system: u8,
22300 #[doc = "Component ID (0 for broadcast)."]
22301 pub target_component: u8,
22302 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22303 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22304 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22305 pub id_or_mac: [u8; 20],
22306 #[doc = "Indicates the type of the operator_id field."]
22307 pub operator_id_type: MavOdidOperatorIdType,
22308 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22309 #[cfg_attr(feature = "ts", ts(type = "string"))]
22310 pub operator_id: CharArray<20>,
22311}
22312impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
22313 pub const ENCODED_LEN: usize = 43usize;
22314 pub const DEFAULT: Self = Self {
22315 target_system: 0_u8,
22316 target_component: 0_u8,
22317 id_or_mac: [0_u8; 20usize],
22318 operator_id_type: MavOdidOperatorIdType::DEFAULT,
22319 operator_id: CharArray::new([0_u8; 20usize]),
22320 };
22321 #[cfg(feature = "arbitrary")]
22322 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22323 use arbitrary::{Arbitrary, Unstructured};
22324 let mut buf = [0u8; 1024];
22325 rng.fill_bytes(&mut buf);
22326 let mut unstructured = Unstructured::new(&buf);
22327 Self::arbitrary(&mut unstructured).unwrap_or_default()
22328 }
22329}
22330impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22331 fn default() -> Self {
22332 Self::DEFAULT.clone()
22333 }
22334}
22335impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22336 type Message = MavMessage;
22337 const ID: u32 = 12905u32;
22338 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
22339 const EXTRA_CRC: u8 = 49u8;
22340 const ENCODED_LEN: usize = 43usize;
22341 fn deser(
22342 _version: MavlinkVersion,
22343 __input: &[u8],
22344 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22345 let avail_len = __input.len();
22346 let mut payload_buf = [0; Self::ENCODED_LEN];
22347 let mut buf = if avail_len < Self::ENCODED_LEN {
22348 payload_buf[0..avail_len].copy_from_slice(__input);
22349 Bytes::new(&payload_buf)
22350 } else {
22351 Bytes::new(__input)
22352 };
22353 let mut __struct = Self::default();
22354 __struct.target_system = buf.get_u8();
22355 __struct.target_component = buf.get_u8();
22356 for v in &mut __struct.id_or_mac {
22357 let val = buf.get_u8();
22358 *v = val;
22359 }
22360 let tmp = buf.get_u8();
22361 __struct.operator_id_type =
22362 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22363 enum_type: "MavOdidOperatorIdType",
22364 value: tmp as u64,
22365 })?;
22366 let mut tmp = [0_u8; 20usize];
22367 for v in &mut tmp {
22368 *v = buf.get_u8();
22369 }
22370 __struct.operator_id = CharArray::new(tmp);
22371 Ok(__struct)
22372 }
22373 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22374 let mut __tmp = BytesMut::new(bytes);
22375 #[allow(clippy::absurd_extreme_comparisons)]
22376 #[allow(unused_comparisons)]
22377 if __tmp.remaining() < Self::ENCODED_LEN {
22378 panic!(
22379 "buffer is too small (need {} bytes, but got {})",
22380 Self::ENCODED_LEN,
22381 __tmp.remaining(),
22382 )
22383 }
22384 __tmp.put_u8(self.target_system);
22385 __tmp.put_u8(self.target_component);
22386 for val in &self.id_or_mac {
22387 __tmp.put_u8(*val);
22388 }
22389 __tmp.put_u8(self.operator_id_type as u8);
22390 for val in &self.operator_id {
22391 __tmp.put_u8(*val);
22392 }
22393 if matches!(version, MavlinkVersion::V2) {
22394 let len = __tmp.len();
22395 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22396 } else {
22397 __tmp.len()
22398 }
22399 }
22400}
22401#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
22402#[doc = ""]
22403#[doc = "ID: 12903"]
22404#[derive(Debug, Clone, PartialEq)]
22405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22407#[cfg_attr(feature = "ts", derive(TS))]
22408#[cfg_attr(feature = "ts", ts(export))]
22409pub struct OPEN_DRONE_ID_SELF_ID_DATA {
22410 #[doc = "System ID (0 for broadcast)."]
22411 pub target_system: u8,
22412 #[doc = "Component ID (0 for broadcast)."]
22413 pub target_component: u8,
22414 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22415 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22416 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22417 pub id_or_mac: [u8; 20],
22418 #[doc = "Indicates the type of the description field."]
22419 pub description_type: MavOdidDescType,
22420 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22421 #[cfg_attr(feature = "ts", ts(type = "string"))]
22422 pub description: CharArray<23>,
22423}
22424impl OPEN_DRONE_ID_SELF_ID_DATA {
22425 pub const ENCODED_LEN: usize = 46usize;
22426 pub const DEFAULT: Self = Self {
22427 target_system: 0_u8,
22428 target_component: 0_u8,
22429 id_or_mac: [0_u8; 20usize],
22430 description_type: MavOdidDescType::DEFAULT,
22431 description: CharArray::new([0_u8; 23usize]),
22432 };
22433 #[cfg(feature = "arbitrary")]
22434 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22435 use arbitrary::{Arbitrary, Unstructured};
22436 let mut buf = [0u8; 1024];
22437 rng.fill_bytes(&mut buf);
22438 let mut unstructured = Unstructured::new(&buf);
22439 Self::arbitrary(&mut unstructured).unwrap_or_default()
22440 }
22441}
22442impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
22443 fn default() -> Self {
22444 Self::DEFAULT.clone()
22445 }
22446}
22447impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
22448 type Message = MavMessage;
22449 const ID: u32 = 12903u32;
22450 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
22451 const EXTRA_CRC: u8 = 249u8;
22452 const ENCODED_LEN: usize = 46usize;
22453 fn deser(
22454 _version: MavlinkVersion,
22455 __input: &[u8],
22456 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22457 let avail_len = __input.len();
22458 let mut payload_buf = [0; Self::ENCODED_LEN];
22459 let mut buf = if avail_len < Self::ENCODED_LEN {
22460 payload_buf[0..avail_len].copy_from_slice(__input);
22461 Bytes::new(&payload_buf)
22462 } else {
22463 Bytes::new(__input)
22464 };
22465 let mut __struct = Self::default();
22466 __struct.target_system = buf.get_u8();
22467 __struct.target_component = buf.get_u8();
22468 for v in &mut __struct.id_or_mac {
22469 let val = buf.get_u8();
22470 *v = val;
22471 }
22472 let tmp = buf.get_u8();
22473 __struct.description_type =
22474 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22475 enum_type: "MavOdidDescType",
22476 value: tmp as u64,
22477 })?;
22478 let mut tmp = [0_u8; 23usize];
22479 for v in &mut tmp {
22480 *v = buf.get_u8();
22481 }
22482 __struct.description = CharArray::new(tmp);
22483 Ok(__struct)
22484 }
22485 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22486 let mut __tmp = BytesMut::new(bytes);
22487 #[allow(clippy::absurd_extreme_comparisons)]
22488 #[allow(unused_comparisons)]
22489 if __tmp.remaining() < Self::ENCODED_LEN {
22490 panic!(
22491 "buffer is too small (need {} bytes, but got {})",
22492 Self::ENCODED_LEN,
22493 __tmp.remaining(),
22494 )
22495 }
22496 __tmp.put_u8(self.target_system);
22497 __tmp.put_u8(self.target_component);
22498 for val in &self.id_or_mac {
22499 __tmp.put_u8(*val);
22500 }
22501 __tmp.put_u8(self.description_type as u8);
22502 for val in &self.description {
22503 __tmp.put_u8(*val);
22504 }
22505 if matches!(version, MavlinkVersion::V2) {
22506 let len = __tmp.len();
22507 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22508 } else {
22509 __tmp.len()
22510 }
22511 }
22512}
22513#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
22514#[doc = ""]
22515#[doc = "ID: 12904"]
22516#[derive(Debug, Clone, PartialEq)]
22517#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22518#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22519#[cfg_attr(feature = "ts", derive(TS))]
22520#[cfg_attr(feature = "ts", ts(export))]
22521pub struct OPEN_DRONE_ID_SYSTEM_DATA {
22522 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22523 pub operator_latitude: i32,
22524 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22525 pub operator_longitude: i32,
22526 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22527 pub area_ceiling: f32,
22528 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22529 pub area_floor: f32,
22530 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22531 pub operator_altitude_geo: f32,
22532 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22533 pub timestamp: u32,
22534 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
22535 pub area_count: u16,
22536 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
22537 pub area_radius: u16,
22538 #[doc = "System ID (0 for broadcast)."]
22539 pub target_system: u8,
22540 #[doc = "Component ID (0 for broadcast)."]
22541 pub target_component: u8,
22542 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22543 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22544 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22545 pub id_or_mac: [u8; 20],
22546 #[doc = "Specifies the operator location type."]
22547 pub operator_location_type: MavOdidOperatorLocationType,
22548 #[doc = "Specifies the classification type of the UA."]
22549 pub classification_type: MavOdidClassificationType,
22550 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
22551 pub category_eu: MavOdidCategoryEu,
22552 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
22553 pub class_eu: MavOdidClassEu,
22554}
22555impl OPEN_DRONE_ID_SYSTEM_DATA {
22556 pub const ENCODED_LEN: usize = 54usize;
22557 pub const DEFAULT: Self = Self {
22558 operator_latitude: 0_i32,
22559 operator_longitude: 0_i32,
22560 area_ceiling: 0.0_f32,
22561 area_floor: 0.0_f32,
22562 operator_altitude_geo: 0.0_f32,
22563 timestamp: 0_u32,
22564 area_count: 0_u16,
22565 area_radius: 0_u16,
22566 target_system: 0_u8,
22567 target_component: 0_u8,
22568 id_or_mac: [0_u8; 20usize],
22569 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
22570 classification_type: MavOdidClassificationType::DEFAULT,
22571 category_eu: MavOdidCategoryEu::DEFAULT,
22572 class_eu: MavOdidClassEu::DEFAULT,
22573 };
22574 #[cfg(feature = "arbitrary")]
22575 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22576 use arbitrary::{Arbitrary, Unstructured};
22577 let mut buf = [0u8; 1024];
22578 rng.fill_bytes(&mut buf);
22579 let mut unstructured = Unstructured::new(&buf);
22580 Self::arbitrary(&mut unstructured).unwrap_or_default()
22581 }
22582}
22583impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
22584 fn default() -> Self {
22585 Self::DEFAULT.clone()
22586 }
22587}
22588impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
22589 type Message = MavMessage;
22590 const ID: u32 = 12904u32;
22591 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
22592 const EXTRA_CRC: u8 = 77u8;
22593 const ENCODED_LEN: usize = 54usize;
22594 fn deser(
22595 _version: MavlinkVersion,
22596 __input: &[u8],
22597 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22598 let avail_len = __input.len();
22599 let mut payload_buf = [0; Self::ENCODED_LEN];
22600 let mut buf = if avail_len < Self::ENCODED_LEN {
22601 payload_buf[0..avail_len].copy_from_slice(__input);
22602 Bytes::new(&payload_buf)
22603 } else {
22604 Bytes::new(__input)
22605 };
22606 let mut __struct = Self::default();
22607 __struct.operator_latitude = buf.get_i32_le();
22608 __struct.operator_longitude = buf.get_i32_le();
22609 __struct.area_ceiling = buf.get_f32_le();
22610 __struct.area_floor = buf.get_f32_le();
22611 __struct.operator_altitude_geo = buf.get_f32_le();
22612 __struct.timestamp = buf.get_u32_le();
22613 __struct.area_count = buf.get_u16_le();
22614 __struct.area_radius = buf.get_u16_le();
22615 __struct.target_system = buf.get_u8();
22616 __struct.target_component = buf.get_u8();
22617 for v in &mut __struct.id_or_mac {
22618 let val = buf.get_u8();
22619 *v = val;
22620 }
22621 let tmp = buf.get_u8();
22622 __struct.operator_location_type =
22623 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22624 enum_type: "MavOdidOperatorLocationType",
22625 value: tmp as u64,
22626 })?;
22627 let tmp = buf.get_u8();
22628 __struct.classification_type =
22629 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22630 enum_type: "MavOdidClassificationType",
22631 value: tmp as u64,
22632 })?;
22633 let tmp = buf.get_u8();
22634 __struct.category_eu =
22635 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22636 enum_type: "MavOdidCategoryEu",
22637 value: tmp as u64,
22638 })?;
22639 let tmp = buf.get_u8();
22640 __struct.class_eu =
22641 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22642 enum_type: "MavOdidClassEu",
22643 value: tmp as u64,
22644 })?;
22645 Ok(__struct)
22646 }
22647 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22648 let mut __tmp = BytesMut::new(bytes);
22649 #[allow(clippy::absurd_extreme_comparisons)]
22650 #[allow(unused_comparisons)]
22651 if __tmp.remaining() < Self::ENCODED_LEN {
22652 panic!(
22653 "buffer is too small (need {} bytes, but got {})",
22654 Self::ENCODED_LEN,
22655 __tmp.remaining(),
22656 )
22657 }
22658 __tmp.put_i32_le(self.operator_latitude);
22659 __tmp.put_i32_le(self.operator_longitude);
22660 __tmp.put_f32_le(self.area_ceiling);
22661 __tmp.put_f32_le(self.area_floor);
22662 __tmp.put_f32_le(self.operator_altitude_geo);
22663 __tmp.put_u32_le(self.timestamp);
22664 __tmp.put_u16_le(self.area_count);
22665 __tmp.put_u16_le(self.area_radius);
22666 __tmp.put_u8(self.target_system);
22667 __tmp.put_u8(self.target_component);
22668 for val in &self.id_or_mac {
22669 __tmp.put_u8(*val);
22670 }
22671 __tmp.put_u8(self.operator_location_type as u8);
22672 __tmp.put_u8(self.classification_type as u8);
22673 __tmp.put_u8(self.category_eu as u8);
22674 __tmp.put_u8(self.class_eu as u8);
22675 if matches!(version, MavlinkVersion::V2) {
22676 let len = __tmp.len();
22677 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22678 } else {
22679 __tmp.len()
22680 }
22681 }
22682}
22683#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22684#[doc = ""]
22685#[doc = "ID: 12919"]
22686#[derive(Debug, Clone, PartialEq)]
22687#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22688#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22689#[cfg_attr(feature = "ts", derive(TS))]
22690#[cfg_attr(feature = "ts", ts(export))]
22691pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22692 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22693 pub operator_latitude: i32,
22694 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22695 pub operator_longitude: i32,
22696 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22697 pub operator_altitude_geo: f32,
22698 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22699 pub timestamp: u32,
22700 #[doc = "System ID (0 for broadcast)."]
22701 pub target_system: u8,
22702 #[doc = "Component ID (0 for broadcast)."]
22703 pub target_component: u8,
22704}
22705impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22706 pub const ENCODED_LEN: usize = 18usize;
22707 pub const DEFAULT: Self = Self {
22708 operator_latitude: 0_i32,
22709 operator_longitude: 0_i32,
22710 operator_altitude_geo: 0.0_f32,
22711 timestamp: 0_u32,
22712 target_system: 0_u8,
22713 target_component: 0_u8,
22714 };
22715 #[cfg(feature = "arbitrary")]
22716 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22717 use arbitrary::{Arbitrary, Unstructured};
22718 let mut buf = [0u8; 1024];
22719 rng.fill_bytes(&mut buf);
22720 let mut unstructured = Unstructured::new(&buf);
22721 Self::arbitrary(&mut unstructured).unwrap_or_default()
22722 }
22723}
22724impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22725 fn default() -> Self {
22726 Self::DEFAULT.clone()
22727 }
22728}
22729impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22730 type Message = MavMessage;
22731 const ID: u32 = 12919u32;
22732 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
22733 const EXTRA_CRC: u8 = 7u8;
22734 const ENCODED_LEN: usize = 18usize;
22735 fn deser(
22736 _version: MavlinkVersion,
22737 __input: &[u8],
22738 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22739 let avail_len = __input.len();
22740 let mut payload_buf = [0; Self::ENCODED_LEN];
22741 let mut buf = if avail_len < Self::ENCODED_LEN {
22742 payload_buf[0..avail_len].copy_from_slice(__input);
22743 Bytes::new(&payload_buf)
22744 } else {
22745 Bytes::new(__input)
22746 };
22747 let mut __struct = Self::default();
22748 __struct.operator_latitude = buf.get_i32_le();
22749 __struct.operator_longitude = buf.get_i32_le();
22750 __struct.operator_altitude_geo = buf.get_f32_le();
22751 __struct.timestamp = buf.get_u32_le();
22752 __struct.target_system = buf.get_u8();
22753 __struct.target_component = buf.get_u8();
22754 Ok(__struct)
22755 }
22756 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22757 let mut __tmp = BytesMut::new(bytes);
22758 #[allow(clippy::absurd_extreme_comparisons)]
22759 #[allow(unused_comparisons)]
22760 if __tmp.remaining() < Self::ENCODED_LEN {
22761 panic!(
22762 "buffer is too small (need {} bytes, but got {})",
22763 Self::ENCODED_LEN,
22764 __tmp.remaining(),
22765 )
22766 }
22767 __tmp.put_i32_le(self.operator_latitude);
22768 __tmp.put_i32_le(self.operator_longitude);
22769 __tmp.put_f32_le(self.operator_altitude_geo);
22770 __tmp.put_u32_le(self.timestamp);
22771 __tmp.put_u8(self.target_system);
22772 __tmp.put_u8(self.target_component);
22773 if matches!(version, MavlinkVersion::V2) {
22774 let len = __tmp.len();
22775 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22776 } else {
22777 __tmp.len()
22778 }
22779 }
22780}
22781#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
22782#[doc = ""]
22783#[doc = "ID: 100"]
22784#[derive(Debug, Clone, PartialEq)]
22785#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22786#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22787#[cfg_attr(feature = "ts", derive(TS))]
22788#[cfg_attr(feature = "ts", ts(export))]
22789pub struct OPTICAL_FLOW_DATA {
22790 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22791 pub time_usec: u64,
22792 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
22793 pub flow_comp_m_x: f32,
22794 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
22795 pub flow_comp_m_y: f32,
22796 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
22797 pub ground_distance: f32,
22798 #[doc = "Flow in x-sensor direction"]
22799 pub flow_x: i16,
22800 #[doc = "Flow in y-sensor direction"]
22801 pub flow_y: i16,
22802 #[doc = "Sensor ID"]
22803 pub sensor_id: u8,
22804 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
22805 pub quality: u8,
22806 #[doc = "Flow rate about X axis"]
22807 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22808 pub flow_rate_x: f32,
22809 #[doc = "Flow rate about Y axis"]
22810 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22811 pub flow_rate_y: f32,
22812}
22813impl OPTICAL_FLOW_DATA {
22814 pub const ENCODED_LEN: usize = 34usize;
22815 pub const DEFAULT: Self = Self {
22816 time_usec: 0_u64,
22817 flow_comp_m_x: 0.0_f32,
22818 flow_comp_m_y: 0.0_f32,
22819 ground_distance: 0.0_f32,
22820 flow_x: 0_i16,
22821 flow_y: 0_i16,
22822 sensor_id: 0_u8,
22823 quality: 0_u8,
22824 flow_rate_x: 0.0_f32,
22825 flow_rate_y: 0.0_f32,
22826 };
22827 #[cfg(feature = "arbitrary")]
22828 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22829 use arbitrary::{Arbitrary, Unstructured};
22830 let mut buf = [0u8; 1024];
22831 rng.fill_bytes(&mut buf);
22832 let mut unstructured = Unstructured::new(&buf);
22833 Self::arbitrary(&mut unstructured).unwrap_or_default()
22834 }
22835}
22836impl Default for OPTICAL_FLOW_DATA {
22837 fn default() -> Self {
22838 Self::DEFAULT.clone()
22839 }
22840}
22841impl MessageData for OPTICAL_FLOW_DATA {
22842 type Message = MavMessage;
22843 const ID: u32 = 100u32;
22844 const NAME: &'static str = "OPTICAL_FLOW";
22845 const EXTRA_CRC: u8 = 175u8;
22846 const ENCODED_LEN: usize = 34usize;
22847 fn deser(
22848 _version: MavlinkVersion,
22849 __input: &[u8],
22850 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22851 let avail_len = __input.len();
22852 let mut payload_buf = [0; Self::ENCODED_LEN];
22853 let mut buf = if avail_len < Self::ENCODED_LEN {
22854 payload_buf[0..avail_len].copy_from_slice(__input);
22855 Bytes::new(&payload_buf)
22856 } else {
22857 Bytes::new(__input)
22858 };
22859 let mut __struct = Self::default();
22860 __struct.time_usec = buf.get_u64_le();
22861 __struct.flow_comp_m_x = buf.get_f32_le();
22862 __struct.flow_comp_m_y = buf.get_f32_le();
22863 __struct.ground_distance = buf.get_f32_le();
22864 __struct.flow_x = buf.get_i16_le();
22865 __struct.flow_y = buf.get_i16_le();
22866 __struct.sensor_id = buf.get_u8();
22867 __struct.quality = buf.get_u8();
22868 __struct.flow_rate_x = buf.get_f32_le();
22869 __struct.flow_rate_y = buf.get_f32_le();
22870 Ok(__struct)
22871 }
22872 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22873 let mut __tmp = BytesMut::new(bytes);
22874 #[allow(clippy::absurd_extreme_comparisons)]
22875 #[allow(unused_comparisons)]
22876 if __tmp.remaining() < Self::ENCODED_LEN {
22877 panic!(
22878 "buffer is too small (need {} bytes, but got {})",
22879 Self::ENCODED_LEN,
22880 __tmp.remaining(),
22881 )
22882 }
22883 __tmp.put_u64_le(self.time_usec);
22884 __tmp.put_f32_le(self.flow_comp_m_x);
22885 __tmp.put_f32_le(self.flow_comp_m_y);
22886 __tmp.put_f32_le(self.ground_distance);
22887 __tmp.put_i16_le(self.flow_x);
22888 __tmp.put_i16_le(self.flow_y);
22889 __tmp.put_u8(self.sensor_id);
22890 __tmp.put_u8(self.quality);
22891 if matches!(version, MavlinkVersion::V2) {
22892 __tmp.put_f32_le(self.flow_rate_x);
22893 __tmp.put_f32_le(self.flow_rate_y);
22894 let len = __tmp.len();
22895 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22896 } else {
22897 __tmp.len()
22898 }
22899 }
22900}
22901#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
22902#[doc = ""]
22903#[doc = "ID: 106"]
22904#[derive(Debug, Clone, PartialEq)]
22905#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22906#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22907#[cfg_attr(feature = "ts", derive(TS))]
22908#[cfg_attr(feature = "ts", ts(export))]
22909pub struct OPTICAL_FLOW_RAD_DATA {
22910 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22911 pub time_usec: u64,
22912 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
22913 pub integration_time_us: u32,
22914 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
22915 pub integrated_x: f32,
22916 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
22917 pub integrated_y: f32,
22918 #[doc = "RH rotation around X axis"]
22919 pub integrated_xgyro: f32,
22920 #[doc = "RH rotation around Y axis"]
22921 pub integrated_ygyro: f32,
22922 #[doc = "RH rotation around Z axis"]
22923 pub integrated_zgyro: f32,
22924 #[doc = "Time since the distance was sampled."]
22925 pub time_delta_distance_us: u32,
22926 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
22927 pub distance: f32,
22928 #[doc = "Temperature"]
22929 pub temperature: i16,
22930 #[doc = "Sensor ID"]
22931 pub sensor_id: u8,
22932 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
22933 pub quality: u8,
22934}
22935impl OPTICAL_FLOW_RAD_DATA {
22936 pub const ENCODED_LEN: usize = 44usize;
22937 pub const DEFAULT: Self = Self {
22938 time_usec: 0_u64,
22939 integration_time_us: 0_u32,
22940 integrated_x: 0.0_f32,
22941 integrated_y: 0.0_f32,
22942 integrated_xgyro: 0.0_f32,
22943 integrated_ygyro: 0.0_f32,
22944 integrated_zgyro: 0.0_f32,
22945 time_delta_distance_us: 0_u32,
22946 distance: 0.0_f32,
22947 temperature: 0_i16,
22948 sensor_id: 0_u8,
22949 quality: 0_u8,
22950 };
22951 #[cfg(feature = "arbitrary")]
22952 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22953 use arbitrary::{Arbitrary, Unstructured};
22954 let mut buf = [0u8; 1024];
22955 rng.fill_bytes(&mut buf);
22956 let mut unstructured = Unstructured::new(&buf);
22957 Self::arbitrary(&mut unstructured).unwrap_or_default()
22958 }
22959}
22960impl Default for OPTICAL_FLOW_RAD_DATA {
22961 fn default() -> Self {
22962 Self::DEFAULT.clone()
22963 }
22964}
22965impl MessageData for OPTICAL_FLOW_RAD_DATA {
22966 type Message = MavMessage;
22967 const ID: u32 = 106u32;
22968 const NAME: &'static str = "OPTICAL_FLOW_RAD";
22969 const EXTRA_CRC: u8 = 138u8;
22970 const ENCODED_LEN: usize = 44usize;
22971 fn deser(
22972 _version: MavlinkVersion,
22973 __input: &[u8],
22974 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22975 let avail_len = __input.len();
22976 let mut payload_buf = [0; Self::ENCODED_LEN];
22977 let mut buf = if avail_len < Self::ENCODED_LEN {
22978 payload_buf[0..avail_len].copy_from_slice(__input);
22979 Bytes::new(&payload_buf)
22980 } else {
22981 Bytes::new(__input)
22982 };
22983 let mut __struct = Self::default();
22984 __struct.time_usec = buf.get_u64_le();
22985 __struct.integration_time_us = buf.get_u32_le();
22986 __struct.integrated_x = buf.get_f32_le();
22987 __struct.integrated_y = buf.get_f32_le();
22988 __struct.integrated_xgyro = buf.get_f32_le();
22989 __struct.integrated_ygyro = buf.get_f32_le();
22990 __struct.integrated_zgyro = buf.get_f32_le();
22991 __struct.time_delta_distance_us = buf.get_u32_le();
22992 __struct.distance = buf.get_f32_le();
22993 __struct.temperature = buf.get_i16_le();
22994 __struct.sensor_id = buf.get_u8();
22995 __struct.quality = buf.get_u8();
22996 Ok(__struct)
22997 }
22998 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22999 let mut __tmp = BytesMut::new(bytes);
23000 #[allow(clippy::absurd_extreme_comparisons)]
23001 #[allow(unused_comparisons)]
23002 if __tmp.remaining() < Self::ENCODED_LEN {
23003 panic!(
23004 "buffer is too small (need {} bytes, but got {})",
23005 Self::ENCODED_LEN,
23006 __tmp.remaining(),
23007 )
23008 }
23009 __tmp.put_u64_le(self.time_usec);
23010 __tmp.put_u32_le(self.integration_time_us);
23011 __tmp.put_f32_le(self.integrated_x);
23012 __tmp.put_f32_le(self.integrated_y);
23013 __tmp.put_f32_le(self.integrated_xgyro);
23014 __tmp.put_f32_le(self.integrated_ygyro);
23015 __tmp.put_f32_le(self.integrated_zgyro);
23016 __tmp.put_u32_le(self.time_delta_distance_us);
23017 __tmp.put_f32_le(self.distance);
23018 __tmp.put_i16_le(self.temperature);
23019 __tmp.put_u8(self.sensor_id);
23020 __tmp.put_u8(self.quality);
23021 if matches!(version, MavlinkVersion::V2) {
23022 let len = __tmp.len();
23023 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23024 } else {
23025 __tmp.len()
23026 }
23027 }
23028}
23029#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
23030#[doc = ""]
23031#[doc = "ID: 360"]
23032#[derive(Debug, Clone, PartialEq)]
23033#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23035#[cfg_attr(feature = "ts", derive(TS))]
23036#[cfg_attr(feature = "ts", ts(export))]
23037pub struct ORBIT_EXECUTION_STATUS_DATA {
23038 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23039 pub time_usec: u64,
23040 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
23041 pub radius: f32,
23042 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23043 pub x: i32,
23044 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23045 pub y: i32,
23046 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
23047 pub z: f32,
23048 #[doc = "The coordinate system of the fields: x, y, z."]
23049 pub frame: MavFrame,
23050}
23051impl ORBIT_EXECUTION_STATUS_DATA {
23052 pub const ENCODED_LEN: usize = 25usize;
23053 pub const DEFAULT: Self = Self {
23054 time_usec: 0_u64,
23055 radius: 0.0_f32,
23056 x: 0_i32,
23057 y: 0_i32,
23058 z: 0.0_f32,
23059 frame: MavFrame::DEFAULT,
23060 };
23061 #[cfg(feature = "arbitrary")]
23062 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23063 use arbitrary::{Arbitrary, Unstructured};
23064 let mut buf = [0u8; 1024];
23065 rng.fill_bytes(&mut buf);
23066 let mut unstructured = Unstructured::new(&buf);
23067 Self::arbitrary(&mut unstructured).unwrap_or_default()
23068 }
23069}
23070impl Default for ORBIT_EXECUTION_STATUS_DATA {
23071 fn default() -> Self {
23072 Self::DEFAULT.clone()
23073 }
23074}
23075impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
23076 type Message = MavMessage;
23077 const ID: u32 = 360u32;
23078 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
23079 const EXTRA_CRC: u8 = 11u8;
23080 const ENCODED_LEN: usize = 25usize;
23081 fn deser(
23082 _version: MavlinkVersion,
23083 __input: &[u8],
23084 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23085 let avail_len = __input.len();
23086 let mut payload_buf = [0; Self::ENCODED_LEN];
23087 let mut buf = if avail_len < Self::ENCODED_LEN {
23088 payload_buf[0..avail_len].copy_from_slice(__input);
23089 Bytes::new(&payload_buf)
23090 } else {
23091 Bytes::new(__input)
23092 };
23093 let mut __struct = Self::default();
23094 __struct.time_usec = buf.get_u64_le();
23095 __struct.radius = buf.get_f32_le();
23096 __struct.x = buf.get_i32_le();
23097 __struct.y = buf.get_i32_le();
23098 __struct.z = buf.get_f32_le();
23099 let tmp = buf.get_u8();
23100 __struct.frame =
23101 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23102 enum_type: "MavFrame",
23103 value: tmp as u64,
23104 })?;
23105 Ok(__struct)
23106 }
23107 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23108 let mut __tmp = BytesMut::new(bytes);
23109 #[allow(clippy::absurd_extreme_comparisons)]
23110 #[allow(unused_comparisons)]
23111 if __tmp.remaining() < Self::ENCODED_LEN {
23112 panic!(
23113 "buffer is too small (need {} bytes, but got {})",
23114 Self::ENCODED_LEN,
23115 __tmp.remaining(),
23116 )
23117 }
23118 __tmp.put_u64_le(self.time_usec);
23119 __tmp.put_f32_le(self.radius);
23120 __tmp.put_i32_le(self.x);
23121 __tmp.put_i32_le(self.y);
23122 __tmp.put_f32_le(self.z);
23123 __tmp.put_u8(self.frame as u8);
23124 if matches!(version, MavlinkVersion::V2) {
23125 let len = __tmp.len();
23126 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23127 } else {
23128 __tmp.len()
23129 }
23130 }
23131}
23132#[doc = "Response from a PARAM_EXT_SET message."]
23133#[doc = ""]
23134#[doc = "ID: 324"]
23135#[derive(Debug, Clone, PartialEq)]
23136#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23137#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23138#[cfg_attr(feature = "ts", derive(TS))]
23139#[cfg_attr(feature = "ts", ts(export))]
23140pub struct PARAM_EXT_ACK_DATA {
23141 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23142 #[cfg_attr(feature = "ts", ts(type = "string"))]
23143 pub param_id: CharArray<16>,
23144 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
23145 #[cfg_attr(feature = "ts", ts(type = "string"))]
23146 pub param_value: CharArray<128>,
23147 #[doc = "Parameter type."]
23148 pub param_type: MavParamExtType,
23149 #[doc = "Result code."]
23150 pub param_result: ParamAck,
23151}
23152impl PARAM_EXT_ACK_DATA {
23153 pub const ENCODED_LEN: usize = 146usize;
23154 pub const DEFAULT: Self = Self {
23155 param_id: CharArray::new([0_u8; 16usize]),
23156 param_value: CharArray::new([0_u8; 128usize]),
23157 param_type: MavParamExtType::DEFAULT,
23158 param_result: ParamAck::DEFAULT,
23159 };
23160 #[cfg(feature = "arbitrary")]
23161 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23162 use arbitrary::{Arbitrary, Unstructured};
23163 let mut buf = [0u8; 1024];
23164 rng.fill_bytes(&mut buf);
23165 let mut unstructured = Unstructured::new(&buf);
23166 Self::arbitrary(&mut unstructured).unwrap_or_default()
23167 }
23168}
23169impl Default for PARAM_EXT_ACK_DATA {
23170 fn default() -> Self {
23171 Self::DEFAULT.clone()
23172 }
23173}
23174impl MessageData for PARAM_EXT_ACK_DATA {
23175 type Message = MavMessage;
23176 const ID: u32 = 324u32;
23177 const NAME: &'static str = "PARAM_EXT_ACK";
23178 const EXTRA_CRC: u8 = 132u8;
23179 const ENCODED_LEN: usize = 146usize;
23180 fn deser(
23181 _version: MavlinkVersion,
23182 __input: &[u8],
23183 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23184 let avail_len = __input.len();
23185 let mut payload_buf = [0; Self::ENCODED_LEN];
23186 let mut buf = if avail_len < Self::ENCODED_LEN {
23187 payload_buf[0..avail_len].copy_from_slice(__input);
23188 Bytes::new(&payload_buf)
23189 } else {
23190 Bytes::new(__input)
23191 };
23192 let mut __struct = Self::default();
23193 let mut tmp = [0_u8; 16usize];
23194 for v in &mut tmp {
23195 *v = buf.get_u8();
23196 }
23197 __struct.param_id = CharArray::new(tmp);
23198 let mut tmp = [0_u8; 128usize];
23199 for v in &mut tmp {
23200 *v = buf.get_u8();
23201 }
23202 __struct.param_value = CharArray::new(tmp);
23203 let tmp = buf.get_u8();
23204 __struct.param_type =
23205 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23206 enum_type: "MavParamExtType",
23207 value: tmp as u64,
23208 })?;
23209 let tmp = buf.get_u8();
23210 __struct.param_result =
23211 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23212 enum_type: "ParamAck",
23213 value: tmp as u64,
23214 })?;
23215 Ok(__struct)
23216 }
23217 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23218 let mut __tmp = BytesMut::new(bytes);
23219 #[allow(clippy::absurd_extreme_comparisons)]
23220 #[allow(unused_comparisons)]
23221 if __tmp.remaining() < Self::ENCODED_LEN {
23222 panic!(
23223 "buffer is too small (need {} bytes, but got {})",
23224 Self::ENCODED_LEN,
23225 __tmp.remaining(),
23226 )
23227 }
23228 for val in &self.param_id {
23229 __tmp.put_u8(*val);
23230 }
23231 for val in &self.param_value {
23232 __tmp.put_u8(*val);
23233 }
23234 __tmp.put_u8(self.param_type as u8);
23235 __tmp.put_u8(self.param_result as u8);
23236 if matches!(version, MavlinkVersion::V2) {
23237 let len = __tmp.len();
23238 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23239 } else {
23240 __tmp.len()
23241 }
23242 }
23243}
23244#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
23245#[doc = ""]
23246#[doc = "ID: 321"]
23247#[derive(Debug, Clone, PartialEq)]
23248#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23249#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23250#[cfg_attr(feature = "ts", derive(TS))]
23251#[cfg_attr(feature = "ts", ts(export))]
23252pub struct PARAM_EXT_REQUEST_LIST_DATA {
23253 #[doc = "System ID"]
23254 pub target_system: u8,
23255 #[doc = "Component ID"]
23256 pub target_component: u8,
23257}
23258impl PARAM_EXT_REQUEST_LIST_DATA {
23259 pub const ENCODED_LEN: usize = 2usize;
23260 pub const DEFAULT: Self = Self {
23261 target_system: 0_u8,
23262 target_component: 0_u8,
23263 };
23264 #[cfg(feature = "arbitrary")]
23265 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23266 use arbitrary::{Arbitrary, Unstructured};
23267 let mut buf = [0u8; 1024];
23268 rng.fill_bytes(&mut buf);
23269 let mut unstructured = Unstructured::new(&buf);
23270 Self::arbitrary(&mut unstructured).unwrap_or_default()
23271 }
23272}
23273impl Default for PARAM_EXT_REQUEST_LIST_DATA {
23274 fn default() -> Self {
23275 Self::DEFAULT.clone()
23276 }
23277}
23278impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
23279 type Message = MavMessage;
23280 const ID: u32 = 321u32;
23281 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
23282 const EXTRA_CRC: u8 = 88u8;
23283 const ENCODED_LEN: usize = 2usize;
23284 fn deser(
23285 _version: MavlinkVersion,
23286 __input: &[u8],
23287 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23288 let avail_len = __input.len();
23289 let mut payload_buf = [0; Self::ENCODED_LEN];
23290 let mut buf = if avail_len < Self::ENCODED_LEN {
23291 payload_buf[0..avail_len].copy_from_slice(__input);
23292 Bytes::new(&payload_buf)
23293 } else {
23294 Bytes::new(__input)
23295 };
23296 let mut __struct = Self::default();
23297 __struct.target_system = buf.get_u8();
23298 __struct.target_component = buf.get_u8();
23299 Ok(__struct)
23300 }
23301 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23302 let mut __tmp = BytesMut::new(bytes);
23303 #[allow(clippy::absurd_extreme_comparisons)]
23304 #[allow(unused_comparisons)]
23305 if __tmp.remaining() < Self::ENCODED_LEN {
23306 panic!(
23307 "buffer is too small (need {} bytes, but got {})",
23308 Self::ENCODED_LEN,
23309 __tmp.remaining(),
23310 )
23311 }
23312 __tmp.put_u8(self.target_system);
23313 __tmp.put_u8(self.target_component);
23314 if matches!(version, MavlinkVersion::V2) {
23315 let len = __tmp.len();
23316 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23317 } else {
23318 __tmp.len()
23319 }
23320 }
23321}
23322#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
23323#[doc = ""]
23324#[doc = "ID: 320"]
23325#[derive(Debug, Clone, PartialEq)]
23326#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23327#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23328#[cfg_attr(feature = "ts", derive(TS))]
23329#[cfg_attr(feature = "ts", ts(export))]
23330pub struct PARAM_EXT_REQUEST_READ_DATA {
23331 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
23332 pub param_index: i16,
23333 #[doc = "System ID"]
23334 pub target_system: u8,
23335 #[doc = "Component ID"]
23336 pub target_component: u8,
23337 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23338 #[cfg_attr(feature = "ts", ts(type = "string"))]
23339 pub param_id: CharArray<16>,
23340}
23341impl PARAM_EXT_REQUEST_READ_DATA {
23342 pub const ENCODED_LEN: usize = 20usize;
23343 pub const DEFAULT: Self = Self {
23344 param_index: 0_i16,
23345 target_system: 0_u8,
23346 target_component: 0_u8,
23347 param_id: CharArray::new([0_u8; 16usize]),
23348 };
23349 #[cfg(feature = "arbitrary")]
23350 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23351 use arbitrary::{Arbitrary, Unstructured};
23352 let mut buf = [0u8; 1024];
23353 rng.fill_bytes(&mut buf);
23354 let mut unstructured = Unstructured::new(&buf);
23355 Self::arbitrary(&mut unstructured).unwrap_or_default()
23356 }
23357}
23358impl Default for PARAM_EXT_REQUEST_READ_DATA {
23359 fn default() -> Self {
23360 Self::DEFAULT.clone()
23361 }
23362}
23363impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
23364 type Message = MavMessage;
23365 const ID: u32 = 320u32;
23366 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
23367 const EXTRA_CRC: u8 = 243u8;
23368 const ENCODED_LEN: usize = 20usize;
23369 fn deser(
23370 _version: MavlinkVersion,
23371 __input: &[u8],
23372 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23373 let avail_len = __input.len();
23374 let mut payload_buf = [0; Self::ENCODED_LEN];
23375 let mut buf = if avail_len < Self::ENCODED_LEN {
23376 payload_buf[0..avail_len].copy_from_slice(__input);
23377 Bytes::new(&payload_buf)
23378 } else {
23379 Bytes::new(__input)
23380 };
23381 let mut __struct = Self::default();
23382 __struct.param_index = buf.get_i16_le();
23383 __struct.target_system = buf.get_u8();
23384 __struct.target_component = buf.get_u8();
23385 let mut tmp = [0_u8; 16usize];
23386 for v in &mut tmp {
23387 *v = buf.get_u8();
23388 }
23389 __struct.param_id = CharArray::new(tmp);
23390 Ok(__struct)
23391 }
23392 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23393 let mut __tmp = BytesMut::new(bytes);
23394 #[allow(clippy::absurd_extreme_comparisons)]
23395 #[allow(unused_comparisons)]
23396 if __tmp.remaining() < Self::ENCODED_LEN {
23397 panic!(
23398 "buffer is too small (need {} bytes, but got {})",
23399 Self::ENCODED_LEN,
23400 __tmp.remaining(),
23401 )
23402 }
23403 __tmp.put_i16_le(self.param_index);
23404 __tmp.put_u8(self.target_system);
23405 __tmp.put_u8(self.target_component);
23406 for val in &self.param_id {
23407 __tmp.put_u8(*val);
23408 }
23409 if matches!(version, MavlinkVersion::V2) {
23410 let len = __tmp.len();
23411 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23412 } else {
23413 __tmp.len()
23414 }
23415 }
23416}
23417#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
23418#[doc = ""]
23419#[doc = "ID: 323"]
23420#[derive(Debug, Clone, PartialEq)]
23421#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23422#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23423#[cfg_attr(feature = "ts", derive(TS))]
23424#[cfg_attr(feature = "ts", ts(export))]
23425pub struct PARAM_EXT_SET_DATA {
23426 #[doc = "System ID"]
23427 pub target_system: u8,
23428 #[doc = "Component ID"]
23429 pub target_component: u8,
23430 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23431 #[cfg_attr(feature = "ts", ts(type = "string"))]
23432 pub param_id: CharArray<16>,
23433 #[doc = "Parameter value"]
23434 #[cfg_attr(feature = "ts", ts(type = "string"))]
23435 pub param_value: CharArray<128>,
23436 #[doc = "Parameter type."]
23437 pub param_type: MavParamExtType,
23438}
23439impl PARAM_EXT_SET_DATA {
23440 pub const ENCODED_LEN: usize = 147usize;
23441 pub const DEFAULT: Self = Self {
23442 target_system: 0_u8,
23443 target_component: 0_u8,
23444 param_id: CharArray::new([0_u8; 16usize]),
23445 param_value: CharArray::new([0_u8; 128usize]),
23446 param_type: MavParamExtType::DEFAULT,
23447 };
23448 #[cfg(feature = "arbitrary")]
23449 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23450 use arbitrary::{Arbitrary, Unstructured};
23451 let mut buf = [0u8; 1024];
23452 rng.fill_bytes(&mut buf);
23453 let mut unstructured = Unstructured::new(&buf);
23454 Self::arbitrary(&mut unstructured).unwrap_or_default()
23455 }
23456}
23457impl Default for PARAM_EXT_SET_DATA {
23458 fn default() -> Self {
23459 Self::DEFAULT.clone()
23460 }
23461}
23462impl MessageData for PARAM_EXT_SET_DATA {
23463 type Message = MavMessage;
23464 const ID: u32 = 323u32;
23465 const NAME: &'static str = "PARAM_EXT_SET";
23466 const EXTRA_CRC: u8 = 78u8;
23467 const ENCODED_LEN: usize = 147usize;
23468 fn deser(
23469 _version: MavlinkVersion,
23470 __input: &[u8],
23471 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23472 let avail_len = __input.len();
23473 let mut payload_buf = [0; Self::ENCODED_LEN];
23474 let mut buf = if avail_len < Self::ENCODED_LEN {
23475 payload_buf[0..avail_len].copy_from_slice(__input);
23476 Bytes::new(&payload_buf)
23477 } else {
23478 Bytes::new(__input)
23479 };
23480 let mut __struct = Self::default();
23481 __struct.target_system = buf.get_u8();
23482 __struct.target_component = buf.get_u8();
23483 let mut tmp = [0_u8; 16usize];
23484 for v in &mut tmp {
23485 *v = buf.get_u8();
23486 }
23487 __struct.param_id = CharArray::new(tmp);
23488 let mut tmp = [0_u8; 128usize];
23489 for v in &mut tmp {
23490 *v = buf.get_u8();
23491 }
23492 __struct.param_value = CharArray::new(tmp);
23493 let tmp = buf.get_u8();
23494 __struct.param_type =
23495 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23496 enum_type: "MavParamExtType",
23497 value: tmp as u64,
23498 })?;
23499 Ok(__struct)
23500 }
23501 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23502 let mut __tmp = BytesMut::new(bytes);
23503 #[allow(clippy::absurd_extreme_comparisons)]
23504 #[allow(unused_comparisons)]
23505 if __tmp.remaining() < Self::ENCODED_LEN {
23506 panic!(
23507 "buffer is too small (need {} bytes, but got {})",
23508 Self::ENCODED_LEN,
23509 __tmp.remaining(),
23510 )
23511 }
23512 __tmp.put_u8(self.target_system);
23513 __tmp.put_u8(self.target_component);
23514 for val in &self.param_id {
23515 __tmp.put_u8(*val);
23516 }
23517 for val in &self.param_value {
23518 __tmp.put_u8(*val);
23519 }
23520 __tmp.put_u8(self.param_type as u8);
23521 if matches!(version, MavlinkVersion::V2) {
23522 let len = __tmp.len();
23523 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23524 } else {
23525 __tmp.len()
23526 }
23527 }
23528}
23529#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
23530#[doc = ""]
23531#[doc = "ID: 322"]
23532#[derive(Debug, Clone, PartialEq)]
23533#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23534#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23535#[cfg_attr(feature = "ts", derive(TS))]
23536#[cfg_attr(feature = "ts", ts(export))]
23537pub struct PARAM_EXT_VALUE_DATA {
23538 #[doc = "Total number of parameters"]
23539 pub param_count: u16,
23540 #[doc = "Index of this parameter"]
23541 pub param_index: u16,
23542 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23543 #[cfg_attr(feature = "ts", ts(type = "string"))]
23544 pub param_id: CharArray<16>,
23545 #[doc = "Parameter value"]
23546 #[cfg_attr(feature = "ts", ts(type = "string"))]
23547 pub param_value: CharArray<128>,
23548 #[doc = "Parameter type."]
23549 pub param_type: MavParamExtType,
23550}
23551impl PARAM_EXT_VALUE_DATA {
23552 pub const ENCODED_LEN: usize = 149usize;
23553 pub const DEFAULT: Self = Self {
23554 param_count: 0_u16,
23555 param_index: 0_u16,
23556 param_id: CharArray::new([0_u8; 16usize]),
23557 param_value: CharArray::new([0_u8; 128usize]),
23558 param_type: MavParamExtType::DEFAULT,
23559 };
23560 #[cfg(feature = "arbitrary")]
23561 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23562 use arbitrary::{Arbitrary, Unstructured};
23563 let mut buf = [0u8; 1024];
23564 rng.fill_bytes(&mut buf);
23565 let mut unstructured = Unstructured::new(&buf);
23566 Self::arbitrary(&mut unstructured).unwrap_or_default()
23567 }
23568}
23569impl Default for PARAM_EXT_VALUE_DATA {
23570 fn default() -> Self {
23571 Self::DEFAULT.clone()
23572 }
23573}
23574impl MessageData for PARAM_EXT_VALUE_DATA {
23575 type Message = MavMessage;
23576 const ID: u32 = 322u32;
23577 const NAME: &'static str = "PARAM_EXT_VALUE";
23578 const EXTRA_CRC: u8 = 243u8;
23579 const ENCODED_LEN: usize = 149usize;
23580 fn deser(
23581 _version: MavlinkVersion,
23582 __input: &[u8],
23583 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23584 let avail_len = __input.len();
23585 let mut payload_buf = [0; Self::ENCODED_LEN];
23586 let mut buf = if avail_len < Self::ENCODED_LEN {
23587 payload_buf[0..avail_len].copy_from_slice(__input);
23588 Bytes::new(&payload_buf)
23589 } else {
23590 Bytes::new(__input)
23591 };
23592 let mut __struct = Self::default();
23593 __struct.param_count = buf.get_u16_le();
23594 __struct.param_index = buf.get_u16_le();
23595 let mut tmp = [0_u8; 16usize];
23596 for v in &mut tmp {
23597 *v = buf.get_u8();
23598 }
23599 __struct.param_id = CharArray::new(tmp);
23600 let mut tmp = [0_u8; 128usize];
23601 for v in &mut tmp {
23602 *v = buf.get_u8();
23603 }
23604 __struct.param_value = CharArray::new(tmp);
23605 let tmp = buf.get_u8();
23606 __struct.param_type =
23607 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23608 enum_type: "MavParamExtType",
23609 value: tmp as u64,
23610 })?;
23611 Ok(__struct)
23612 }
23613 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23614 let mut __tmp = BytesMut::new(bytes);
23615 #[allow(clippy::absurd_extreme_comparisons)]
23616 #[allow(unused_comparisons)]
23617 if __tmp.remaining() < Self::ENCODED_LEN {
23618 panic!(
23619 "buffer is too small (need {} bytes, but got {})",
23620 Self::ENCODED_LEN,
23621 __tmp.remaining(),
23622 )
23623 }
23624 __tmp.put_u16_le(self.param_count);
23625 __tmp.put_u16_le(self.param_index);
23626 for val in &self.param_id {
23627 __tmp.put_u8(*val);
23628 }
23629 for val in &self.param_value {
23630 __tmp.put_u8(*val);
23631 }
23632 __tmp.put_u8(self.param_type as u8);
23633 if matches!(version, MavlinkVersion::V2) {
23634 let len = __tmp.len();
23635 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23636 } else {
23637 __tmp.len()
23638 }
23639 }
23640}
23641#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
23642#[doc = ""]
23643#[doc = "ID: 50"]
23644#[derive(Debug, Clone, PartialEq)]
23645#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23646#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23647#[cfg_attr(feature = "ts", derive(TS))]
23648#[cfg_attr(feature = "ts", ts(export))]
23649pub struct PARAM_MAP_RC_DATA {
23650 #[doc = "Initial parameter value"]
23651 pub param_value0: f32,
23652 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
23653 pub scale: f32,
23654 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
23655 pub param_value_min: f32,
23656 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
23657 pub param_value_max: f32,
23658 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
23659 pub param_index: i16,
23660 #[doc = "System ID"]
23661 pub target_system: u8,
23662 #[doc = "Component ID"]
23663 pub target_component: u8,
23664 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23665 #[cfg_attr(feature = "ts", ts(type = "string"))]
23666 pub param_id: CharArray<16>,
23667 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
23668 pub parameter_rc_channel_index: u8,
23669}
23670impl PARAM_MAP_RC_DATA {
23671 pub const ENCODED_LEN: usize = 37usize;
23672 pub const DEFAULT: Self = Self {
23673 param_value0: 0.0_f32,
23674 scale: 0.0_f32,
23675 param_value_min: 0.0_f32,
23676 param_value_max: 0.0_f32,
23677 param_index: 0_i16,
23678 target_system: 0_u8,
23679 target_component: 0_u8,
23680 param_id: CharArray::new([0_u8; 16usize]),
23681 parameter_rc_channel_index: 0_u8,
23682 };
23683 #[cfg(feature = "arbitrary")]
23684 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23685 use arbitrary::{Arbitrary, Unstructured};
23686 let mut buf = [0u8; 1024];
23687 rng.fill_bytes(&mut buf);
23688 let mut unstructured = Unstructured::new(&buf);
23689 Self::arbitrary(&mut unstructured).unwrap_or_default()
23690 }
23691}
23692impl Default for PARAM_MAP_RC_DATA {
23693 fn default() -> Self {
23694 Self::DEFAULT.clone()
23695 }
23696}
23697impl MessageData for PARAM_MAP_RC_DATA {
23698 type Message = MavMessage;
23699 const ID: u32 = 50u32;
23700 const NAME: &'static str = "PARAM_MAP_RC";
23701 const EXTRA_CRC: u8 = 78u8;
23702 const ENCODED_LEN: usize = 37usize;
23703 fn deser(
23704 _version: MavlinkVersion,
23705 __input: &[u8],
23706 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23707 let avail_len = __input.len();
23708 let mut payload_buf = [0; Self::ENCODED_LEN];
23709 let mut buf = if avail_len < Self::ENCODED_LEN {
23710 payload_buf[0..avail_len].copy_from_slice(__input);
23711 Bytes::new(&payload_buf)
23712 } else {
23713 Bytes::new(__input)
23714 };
23715 let mut __struct = Self::default();
23716 __struct.param_value0 = buf.get_f32_le();
23717 __struct.scale = buf.get_f32_le();
23718 __struct.param_value_min = buf.get_f32_le();
23719 __struct.param_value_max = buf.get_f32_le();
23720 __struct.param_index = buf.get_i16_le();
23721 __struct.target_system = buf.get_u8();
23722 __struct.target_component = buf.get_u8();
23723 let mut tmp = [0_u8; 16usize];
23724 for v in &mut tmp {
23725 *v = buf.get_u8();
23726 }
23727 __struct.param_id = CharArray::new(tmp);
23728 __struct.parameter_rc_channel_index = buf.get_u8();
23729 Ok(__struct)
23730 }
23731 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23732 let mut __tmp = BytesMut::new(bytes);
23733 #[allow(clippy::absurd_extreme_comparisons)]
23734 #[allow(unused_comparisons)]
23735 if __tmp.remaining() < Self::ENCODED_LEN {
23736 panic!(
23737 "buffer is too small (need {} bytes, but got {})",
23738 Self::ENCODED_LEN,
23739 __tmp.remaining(),
23740 )
23741 }
23742 __tmp.put_f32_le(self.param_value0);
23743 __tmp.put_f32_le(self.scale);
23744 __tmp.put_f32_le(self.param_value_min);
23745 __tmp.put_f32_le(self.param_value_max);
23746 __tmp.put_i16_le(self.param_index);
23747 __tmp.put_u8(self.target_system);
23748 __tmp.put_u8(self.target_component);
23749 for val in &self.param_id {
23750 __tmp.put_u8(*val);
23751 }
23752 __tmp.put_u8(self.parameter_rc_channel_index);
23753 if matches!(version, MavlinkVersion::V2) {
23754 let len = __tmp.len();
23755 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23756 } else {
23757 __tmp.len()
23758 }
23759 }
23760}
23761#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23762#[doc = ""]
23763#[doc = "ID: 21"]
23764#[derive(Debug, Clone, PartialEq)]
23765#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23766#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23767#[cfg_attr(feature = "ts", derive(TS))]
23768#[cfg_attr(feature = "ts", ts(export))]
23769pub struct PARAM_REQUEST_LIST_DATA {
23770 #[doc = "System ID"]
23771 pub target_system: u8,
23772 #[doc = "Component ID"]
23773 pub target_component: u8,
23774}
23775impl PARAM_REQUEST_LIST_DATA {
23776 pub const ENCODED_LEN: usize = 2usize;
23777 pub const DEFAULT: Self = Self {
23778 target_system: 0_u8,
23779 target_component: 0_u8,
23780 };
23781 #[cfg(feature = "arbitrary")]
23782 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23783 use arbitrary::{Arbitrary, Unstructured};
23784 let mut buf = [0u8; 1024];
23785 rng.fill_bytes(&mut buf);
23786 let mut unstructured = Unstructured::new(&buf);
23787 Self::arbitrary(&mut unstructured).unwrap_or_default()
23788 }
23789}
23790impl Default for PARAM_REQUEST_LIST_DATA {
23791 fn default() -> Self {
23792 Self::DEFAULT.clone()
23793 }
23794}
23795impl MessageData for PARAM_REQUEST_LIST_DATA {
23796 type Message = MavMessage;
23797 const ID: u32 = 21u32;
23798 const NAME: &'static str = "PARAM_REQUEST_LIST";
23799 const EXTRA_CRC: u8 = 159u8;
23800 const ENCODED_LEN: usize = 2usize;
23801 fn deser(
23802 _version: MavlinkVersion,
23803 __input: &[u8],
23804 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23805 let avail_len = __input.len();
23806 let mut payload_buf = [0; Self::ENCODED_LEN];
23807 let mut buf = if avail_len < Self::ENCODED_LEN {
23808 payload_buf[0..avail_len].copy_from_slice(__input);
23809 Bytes::new(&payload_buf)
23810 } else {
23811 Bytes::new(__input)
23812 };
23813 let mut __struct = Self::default();
23814 __struct.target_system = buf.get_u8();
23815 __struct.target_component = buf.get_u8();
23816 Ok(__struct)
23817 }
23818 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23819 let mut __tmp = BytesMut::new(bytes);
23820 #[allow(clippy::absurd_extreme_comparisons)]
23821 #[allow(unused_comparisons)]
23822 if __tmp.remaining() < Self::ENCODED_LEN {
23823 panic!(
23824 "buffer is too small (need {} bytes, but got {})",
23825 Self::ENCODED_LEN,
23826 __tmp.remaining(),
23827 )
23828 }
23829 __tmp.put_u8(self.target_system);
23830 __tmp.put_u8(self.target_component);
23831 if matches!(version, MavlinkVersion::V2) {
23832 let len = __tmp.len();
23833 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23834 } else {
23835 __tmp.len()
23836 }
23837 }
23838}
23839#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
23840#[doc = ""]
23841#[doc = "ID: 20"]
23842#[derive(Debug, Clone, PartialEq)]
23843#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23844#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23845#[cfg_attr(feature = "ts", derive(TS))]
23846#[cfg_attr(feature = "ts", ts(export))]
23847pub struct PARAM_REQUEST_READ_DATA {
23848 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
23849 pub param_index: i16,
23850 #[doc = "System ID"]
23851 pub target_system: u8,
23852 #[doc = "Component ID"]
23853 pub target_component: u8,
23854 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23855 #[cfg_attr(feature = "ts", ts(type = "string"))]
23856 pub param_id: CharArray<16>,
23857}
23858impl PARAM_REQUEST_READ_DATA {
23859 pub const ENCODED_LEN: usize = 20usize;
23860 pub const DEFAULT: Self = Self {
23861 param_index: 0_i16,
23862 target_system: 0_u8,
23863 target_component: 0_u8,
23864 param_id: CharArray::new([0_u8; 16usize]),
23865 };
23866 #[cfg(feature = "arbitrary")]
23867 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23868 use arbitrary::{Arbitrary, Unstructured};
23869 let mut buf = [0u8; 1024];
23870 rng.fill_bytes(&mut buf);
23871 let mut unstructured = Unstructured::new(&buf);
23872 Self::arbitrary(&mut unstructured).unwrap_or_default()
23873 }
23874}
23875impl Default for PARAM_REQUEST_READ_DATA {
23876 fn default() -> Self {
23877 Self::DEFAULT.clone()
23878 }
23879}
23880impl MessageData for PARAM_REQUEST_READ_DATA {
23881 type Message = MavMessage;
23882 const ID: u32 = 20u32;
23883 const NAME: &'static str = "PARAM_REQUEST_READ";
23884 const EXTRA_CRC: u8 = 214u8;
23885 const ENCODED_LEN: usize = 20usize;
23886 fn deser(
23887 _version: MavlinkVersion,
23888 __input: &[u8],
23889 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23890 let avail_len = __input.len();
23891 let mut payload_buf = [0; Self::ENCODED_LEN];
23892 let mut buf = if avail_len < Self::ENCODED_LEN {
23893 payload_buf[0..avail_len].copy_from_slice(__input);
23894 Bytes::new(&payload_buf)
23895 } else {
23896 Bytes::new(__input)
23897 };
23898 let mut __struct = Self::default();
23899 __struct.param_index = buf.get_i16_le();
23900 __struct.target_system = buf.get_u8();
23901 __struct.target_component = buf.get_u8();
23902 let mut tmp = [0_u8; 16usize];
23903 for v in &mut tmp {
23904 *v = buf.get_u8();
23905 }
23906 __struct.param_id = CharArray::new(tmp);
23907 Ok(__struct)
23908 }
23909 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23910 let mut __tmp = BytesMut::new(bytes);
23911 #[allow(clippy::absurd_extreme_comparisons)]
23912 #[allow(unused_comparisons)]
23913 if __tmp.remaining() < Self::ENCODED_LEN {
23914 panic!(
23915 "buffer is too small (need {} bytes, but got {})",
23916 Self::ENCODED_LEN,
23917 __tmp.remaining(),
23918 )
23919 }
23920 __tmp.put_i16_le(self.param_index);
23921 __tmp.put_u8(self.target_system);
23922 __tmp.put_u8(self.target_component);
23923 for val in &self.param_id {
23924 __tmp.put_u8(*val);
23925 }
23926 if matches!(version, MavlinkVersion::V2) {
23927 let len = __tmp.len();
23928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23929 } else {
23930 __tmp.len()
23931 }
23932 }
23933}
23934#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23935#[doc = ""]
23936#[doc = "ID: 23"]
23937#[derive(Debug, Clone, PartialEq)]
23938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23940#[cfg_attr(feature = "ts", derive(TS))]
23941#[cfg_attr(feature = "ts", ts(export))]
23942pub struct PARAM_SET_DATA {
23943 #[doc = "Onboard parameter value"]
23944 pub param_value: f32,
23945 #[doc = "System ID"]
23946 pub target_system: u8,
23947 #[doc = "Component ID"]
23948 pub target_component: u8,
23949 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23950 #[cfg_attr(feature = "ts", ts(type = "string"))]
23951 pub param_id: CharArray<16>,
23952 #[doc = "Onboard parameter type."]
23953 pub param_type: MavParamType,
23954}
23955impl PARAM_SET_DATA {
23956 pub const ENCODED_LEN: usize = 23usize;
23957 pub const DEFAULT: Self = Self {
23958 param_value: 0.0_f32,
23959 target_system: 0_u8,
23960 target_component: 0_u8,
23961 param_id: CharArray::new([0_u8; 16usize]),
23962 param_type: MavParamType::DEFAULT,
23963 };
23964 #[cfg(feature = "arbitrary")]
23965 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23966 use arbitrary::{Arbitrary, Unstructured};
23967 let mut buf = [0u8; 1024];
23968 rng.fill_bytes(&mut buf);
23969 let mut unstructured = Unstructured::new(&buf);
23970 Self::arbitrary(&mut unstructured).unwrap_or_default()
23971 }
23972}
23973impl Default for PARAM_SET_DATA {
23974 fn default() -> Self {
23975 Self::DEFAULT.clone()
23976 }
23977}
23978impl MessageData for PARAM_SET_DATA {
23979 type Message = MavMessage;
23980 const ID: u32 = 23u32;
23981 const NAME: &'static str = "PARAM_SET";
23982 const EXTRA_CRC: u8 = 168u8;
23983 const ENCODED_LEN: usize = 23usize;
23984 fn deser(
23985 _version: MavlinkVersion,
23986 __input: &[u8],
23987 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23988 let avail_len = __input.len();
23989 let mut payload_buf = [0; Self::ENCODED_LEN];
23990 let mut buf = if avail_len < Self::ENCODED_LEN {
23991 payload_buf[0..avail_len].copy_from_slice(__input);
23992 Bytes::new(&payload_buf)
23993 } else {
23994 Bytes::new(__input)
23995 };
23996 let mut __struct = Self::default();
23997 __struct.param_value = buf.get_f32_le();
23998 __struct.target_system = buf.get_u8();
23999 __struct.target_component = buf.get_u8();
24000 let mut tmp = [0_u8; 16usize];
24001 for v in &mut tmp {
24002 *v = buf.get_u8();
24003 }
24004 __struct.param_id = CharArray::new(tmp);
24005 let tmp = buf.get_u8();
24006 __struct.param_type =
24007 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24008 enum_type: "MavParamType",
24009 value: tmp as u64,
24010 })?;
24011 Ok(__struct)
24012 }
24013 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24014 let mut __tmp = BytesMut::new(bytes);
24015 #[allow(clippy::absurd_extreme_comparisons)]
24016 #[allow(unused_comparisons)]
24017 if __tmp.remaining() < Self::ENCODED_LEN {
24018 panic!(
24019 "buffer is too small (need {} bytes, but got {})",
24020 Self::ENCODED_LEN,
24021 __tmp.remaining(),
24022 )
24023 }
24024 __tmp.put_f32_le(self.param_value);
24025 __tmp.put_u8(self.target_system);
24026 __tmp.put_u8(self.target_component);
24027 for val in &self.param_id {
24028 __tmp.put_u8(*val);
24029 }
24030 __tmp.put_u8(self.param_type as u8);
24031 if matches!(version, MavlinkVersion::V2) {
24032 let len = __tmp.len();
24033 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24034 } else {
24035 __tmp.len()
24036 }
24037 }
24038}
24039#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24040#[doc = ""]
24041#[doc = "ID: 22"]
24042#[derive(Debug, Clone, PartialEq)]
24043#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24045#[cfg_attr(feature = "ts", derive(TS))]
24046#[cfg_attr(feature = "ts", ts(export))]
24047pub struct PARAM_VALUE_DATA {
24048 #[doc = "Onboard parameter value"]
24049 pub param_value: f32,
24050 #[doc = "Total number of onboard parameters"]
24051 pub param_count: u16,
24052 #[doc = "Index of this onboard parameter"]
24053 pub param_index: u16,
24054 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24055 #[cfg_attr(feature = "ts", ts(type = "string"))]
24056 pub param_id: CharArray<16>,
24057 #[doc = "Onboard parameter type."]
24058 pub param_type: MavParamType,
24059}
24060impl PARAM_VALUE_DATA {
24061 pub const ENCODED_LEN: usize = 25usize;
24062 pub const DEFAULT: Self = Self {
24063 param_value: 0.0_f32,
24064 param_count: 0_u16,
24065 param_index: 0_u16,
24066 param_id: CharArray::new([0_u8; 16usize]),
24067 param_type: MavParamType::DEFAULT,
24068 };
24069 #[cfg(feature = "arbitrary")]
24070 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24071 use arbitrary::{Arbitrary, Unstructured};
24072 let mut buf = [0u8; 1024];
24073 rng.fill_bytes(&mut buf);
24074 let mut unstructured = Unstructured::new(&buf);
24075 Self::arbitrary(&mut unstructured).unwrap_or_default()
24076 }
24077}
24078impl Default for PARAM_VALUE_DATA {
24079 fn default() -> Self {
24080 Self::DEFAULT.clone()
24081 }
24082}
24083impl MessageData for PARAM_VALUE_DATA {
24084 type Message = MavMessage;
24085 const ID: u32 = 22u32;
24086 const NAME: &'static str = "PARAM_VALUE";
24087 const EXTRA_CRC: u8 = 220u8;
24088 const ENCODED_LEN: usize = 25usize;
24089 fn deser(
24090 _version: MavlinkVersion,
24091 __input: &[u8],
24092 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24093 let avail_len = __input.len();
24094 let mut payload_buf = [0; Self::ENCODED_LEN];
24095 let mut buf = if avail_len < Self::ENCODED_LEN {
24096 payload_buf[0..avail_len].copy_from_slice(__input);
24097 Bytes::new(&payload_buf)
24098 } else {
24099 Bytes::new(__input)
24100 };
24101 let mut __struct = Self::default();
24102 __struct.param_value = buf.get_f32_le();
24103 __struct.param_count = buf.get_u16_le();
24104 __struct.param_index = buf.get_u16_le();
24105 let mut tmp = [0_u8; 16usize];
24106 for v in &mut tmp {
24107 *v = buf.get_u8();
24108 }
24109 __struct.param_id = CharArray::new(tmp);
24110 let tmp = buf.get_u8();
24111 __struct.param_type =
24112 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24113 enum_type: "MavParamType",
24114 value: tmp as u64,
24115 })?;
24116 Ok(__struct)
24117 }
24118 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24119 let mut __tmp = BytesMut::new(bytes);
24120 #[allow(clippy::absurd_extreme_comparisons)]
24121 #[allow(unused_comparisons)]
24122 if __tmp.remaining() < Self::ENCODED_LEN {
24123 panic!(
24124 "buffer is too small (need {} bytes, but got {})",
24125 Self::ENCODED_LEN,
24126 __tmp.remaining(),
24127 )
24128 }
24129 __tmp.put_f32_le(self.param_value);
24130 __tmp.put_u16_le(self.param_count);
24131 __tmp.put_u16_le(self.param_index);
24132 for val in &self.param_id {
24133 __tmp.put_u8(*val);
24134 }
24135 __tmp.put_u8(self.param_type as u8);
24136 if matches!(version, MavlinkVersion::V2) {
24137 let len = __tmp.len();
24138 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24139 } else {
24140 __tmp.len()
24141 }
24142 }
24143}
24144#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
24145#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
24146#[doc = ""]
24147#[doc = "ID: 4"]
24148#[derive(Debug, Clone, PartialEq)]
24149#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24150#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24151#[cfg_attr(feature = "ts", derive(TS))]
24152#[cfg_attr(feature = "ts", ts(export))]
24153pub struct PING_DATA {
24154 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24155 pub time_usec: u64,
24156 #[doc = "PING sequence"]
24157 pub seq: u32,
24158 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
24159 pub target_system: u8,
24160 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
24161 pub target_component: u8,
24162}
24163impl PING_DATA {
24164 pub const ENCODED_LEN: usize = 14usize;
24165 pub const DEFAULT: Self = Self {
24166 time_usec: 0_u64,
24167 seq: 0_u32,
24168 target_system: 0_u8,
24169 target_component: 0_u8,
24170 };
24171 #[cfg(feature = "arbitrary")]
24172 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24173 use arbitrary::{Arbitrary, Unstructured};
24174 let mut buf = [0u8; 1024];
24175 rng.fill_bytes(&mut buf);
24176 let mut unstructured = Unstructured::new(&buf);
24177 Self::arbitrary(&mut unstructured).unwrap_or_default()
24178 }
24179}
24180impl Default for PING_DATA {
24181 fn default() -> Self {
24182 Self::DEFAULT.clone()
24183 }
24184}
24185impl MessageData for PING_DATA {
24186 type Message = MavMessage;
24187 const ID: u32 = 4u32;
24188 const NAME: &'static str = "PING";
24189 const EXTRA_CRC: u8 = 237u8;
24190 const ENCODED_LEN: usize = 14usize;
24191 fn deser(
24192 _version: MavlinkVersion,
24193 __input: &[u8],
24194 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24195 let avail_len = __input.len();
24196 let mut payload_buf = [0; Self::ENCODED_LEN];
24197 let mut buf = if avail_len < Self::ENCODED_LEN {
24198 payload_buf[0..avail_len].copy_from_slice(__input);
24199 Bytes::new(&payload_buf)
24200 } else {
24201 Bytes::new(__input)
24202 };
24203 let mut __struct = Self::default();
24204 __struct.time_usec = buf.get_u64_le();
24205 __struct.seq = buf.get_u32_le();
24206 __struct.target_system = buf.get_u8();
24207 __struct.target_component = buf.get_u8();
24208 Ok(__struct)
24209 }
24210 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24211 let mut __tmp = BytesMut::new(bytes);
24212 #[allow(clippy::absurd_extreme_comparisons)]
24213 #[allow(unused_comparisons)]
24214 if __tmp.remaining() < Self::ENCODED_LEN {
24215 panic!(
24216 "buffer is too small (need {} bytes, but got {})",
24217 Self::ENCODED_LEN,
24218 __tmp.remaining(),
24219 )
24220 }
24221 __tmp.put_u64_le(self.time_usec);
24222 __tmp.put_u32_le(self.seq);
24223 __tmp.put_u8(self.target_system);
24224 __tmp.put_u8(self.target_component);
24225 if matches!(version, MavlinkVersion::V2) {
24226 let len = __tmp.len();
24227 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24228 } else {
24229 __tmp.len()
24230 }
24231 }
24232}
24233#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
24234#[doc = "Control vehicle tone generation (buzzer)."]
24235#[doc = ""]
24236#[doc = "ID: 258"]
24237#[derive(Debug, Clone, PartialEq)]
24238#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24239#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24240#[cfg_attr(feature = "ts", derive(TS))]
24241#[cfg_attr(feature = "ts", ts(export))]
24242pub struct PLAY_TUNE_DATA {
24243 #[doc = "System ID"]
24244 pub target_system: u8,
24245 #[doc = "Component ID"]
24246 pub target_component: u8,
24247 #[doc = "tune in board specific format"]
24248 #[cfg_attr(feature = "ts", ts(type = "string"))]
24249 pub tune: CharArray<30>,
24250 #[doc = "tune extension (appended to tune)"]
24251 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24252 #[cfg_attr(feature = "ts", ts(type = "string"))]
24253 pub tune2: CharArray<200>,
24254}
24255impl PLAY_TUNE_DATA {
24256 pub const ENCODED_LEN: usize = 232usize;
24257 pub const DEFAULT: Self = Self {
24258 target_system: 0_u8,
24259 target_component: 0_u8,
24260 tune: CharArray::new([0_u8; 30usize]),
24261 tune2: CharArray::new([0_u8; 200usize]),
24262 };
24263 #[cfg(feature = "arbitrary")]
24264 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24265 use arbitrary::{Arbitrary, Unstructured};
24266 let mut buf = [0u8; 1024];
24267 rng.fill_bytes(&mut buf);
24268 let mut unstructured = Unstructured::new(&buf);
24269 Self::arbitrary(&mut unstructured).unwrap_or_default()
24270 }
24271}
24272impl Default for PLAY_TUNE_DATA {
24273 fn default() -> Self {
24274 Self::DEFAULT.clone()
24275 }
24276}
24277impl MessageData for PLAY_TUNE_DATA {
24278 type Message = MavMessage;
24279 const ID: u32 = 258u32;
24280 const NAME: &'static str = "PLAY_TUNE";
24281 const EXTRA_CRC: u8 = 187u8;
24282 const ENCODED_LEN: usize = 232usize;
24283 fn deser(
24284 _version: MavlinkVersion,
24285 __input: &[u8],
24286 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24287 let avail_len = __input.len();
24288 let mut payload_buf = [0; Self::ENCODED_LEN];
24289 let mut buf = if avail_len < Self::ENCODED_LEN {
24290 payload_buf[0..avail_len].copy_from_slice(__input);
24291 Bytes::new(&payload_buf)
24292 } else {
24293 Bytes::new(__input)
24294 };
24295 let mut __struct = Self::default();
24296 __struct.target_system = buf.get_u8();
24297 __struct.target_component = buf.get_u8();
24298 let mut tmp = [0_u8; 30usize];
24299 for v in &mut tmp {
24300 *v = buf.get_u8();
24301 }
24302 __struct.tune = CharArray::new(tmp);
24303 let mut tmp = [0_u8; 200usize];
24304 for v in &mut tmp {
24305 *v = buf.get_u8();
24306 }
24307 __struct.tune2 = CharArray::new(tmp);
24308 Ok(__struct)
24309 }
24310 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24311 let mut __tmp = BytesMut::new(bytes);
24312 #[allow(clippy::absurd_extreme_comparisons)]
24313 #[allow(unused_comparisons)]
24314 if __tmp.remaining() < Self::ENCODED_LEN {
24315 panic!(
24316 "buffer is too small (need {} bytes, but got {})",
24317 Self::ENCODED_LEN,
24318 __tmp.remaining(),
24319 )
24320 }
24321 __tmp.put_u8(self.target_system);
24322 __tmp.put_u8(self.target_component);
24323 for val in &self.tune {
24324 __tmp.put_u8(*val);
24325 }
24326 if matches!(version, MavlinkVersion::V2) {
24327 for val in &self.tune2 {
24328 __tmp.put_u8(*val);
24329 }
24330 let len = __tmp.len();
24331 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24332 } else {
24333 __tmp.len()
24334 }
24335 }
24336}
24337#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
24338#[doc = ""]
24339#[doc = "ID: 400"]
24340#[derive(Debug, Clone, PartialEq)]
24341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24343#[cfg_attr(feature = "ts", derive(TS))]
24344#[cfg_attr(feature = "ts", ts(export))]
24345pub struct PLAY_TUNE_V2_DATA {
24346 #[doc = "Tune format"]
24347 pub format: TuneFormat,
24348 #[doc = "System ID"]
24349 pub target_system: u8,
24350 #[doc = "Component ID"]
24351 pub target_component: u8,
24352 #[doc = "Tune definition as a NULL-terminated string."]
24353 #[cfg_attr(feature = "ts", ts(type = "string"))]
24354 pub tune: CharArray<248>,
24355}
24356impl PLAY_TUNE_V2_DATA {
24357 pub const ENCODED_LEN: usize = 254usize;
24358 pub const DEFAULT: Self = Self {
24359 format: TuneFormat::DEFAULT,
24360 target_system: 0_u8,
24361 target_component: 0_u8,
24362 tune: CharArray::new([0_u8; 248usize]),
24363 };
24364 #[cfg(feature = "arbitrary")]
24365 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24366 use arbitrary::{Arbitrary, Unstructured};
24367 let mut buf = [0u8; 1024];
24368 rng.fill_bytes(&mut buf);
24369 let mut unstructured = Unstructured::new(&buf);
24370 Self::arbitrary(&mut unstructured).unwrap_or_default()
24371 }
24372}
24373impl Default for PLAY_TUNE_V2_DATA {
24374 fn default() -> Self {
24375 Self::DEFAULT.clone()
24376 }
24377}
24378impl MessageData for PLAY_TUNE_V2_DATA {
24379 type Message = MavMessage;
24380 const ID: u32 = 400u32;
24381 const NAME: &'static str = "PLAY_TUNE_V2";
24382 const EXTRA_CRC: u8 = 110u8;
24383 const ENCODED_LEN: usize = 254usize;
24384 fn deser(
24385 _version: MavlinkVersion,
24386 __input: &[u8],
24387 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24388 let avail_len = __input.len();
24389 let mut payload_buf = [0; Self::ENCODED_LEN];
24390 let mut buf = if avail_len < Self::ENCODED_LEN {
24391 payload_buf[0..avail_len].copy_from_slice(__input);
24392 Bytes::new(&payload_buf)
24393 } else {
24394 Bytes::new(__input)
24395 };
24396 let mut __struct = Self::default();
24397 let tmp = buf.get_u32_le();
24398 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
24399 ::mavlink_core::error::ParserError::InvalidEnum {
24400 enum_type: "TuneFormat",
24401 value: tmp as u64,
24402 },
24403 )?;
24404 __struct.target_system = buf.get_u8();
24405 __struct.target_component = buf.get_u8();
24406 let mut tmp = [0_u8; 248usize];
24407 for v in &mut tmp {
24408 *v = buf.get_u8();
24409 }
24410 __struct.tune = CharArray::new(tmp);
24411 Ok(__struct)
24412 }
24413 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24414 let mut __tmp = BytesMut::new(bytes);
24415 #[allow(clippy::absurd_extreme_comparisons)]
24416 #[allow(unused_comparisons)]
24417 if __tmp.remaining() < Self::ENCODED_LEN {
24418 panic!(
24419 "buffer is too small (need {} bytes, but got {})",
24420 Self::ENCODED_LEN,
24421 __tmp.remaining(),
24422 )
24423 }
24424 __tmp.put_u32_le(self.format as u32);
24425 __tmp.put_u8(self.target_system);
24426 __tmp.put_u8(self.target_component);
24427 for val in &self.tune {
24428 __tmp.put_u8(*val);
24429 }
24430 if matches!(version, MavlinkVersion::V2) {
24431 let len = __tmp.len();
24432 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24433 } else {
24434 __tmp.len()
24435 }
24436 }
24437}
24438#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
24439#[doc = ""]
24440#[doc = "ID: 87"]
24441#[derive(Debug, Clone, PartialEq)]
24442#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24443#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24444#[cfg_attr(feature = "ts", derive(TS))]
24445#[cfg_attr(feature = "ts", ts(export))]
24446pub struct POSITION_TARGET_GLOBAL_INT_DATA {
24447 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
24448 pub time_boot_ms: u32,
24449 #[doc = "Latitude in WGS84 frame"]
24450 pub lat_int: i32,
24451 #[doc = "Longitude in WGS84 frame"]
24452 pub lon_int: i32,
24453 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
24454 pub alt: f32,
24455 #[doc = "X velocity in NED frame"]
24456 pub vx: f32,
24457 #[doc = "Y velocity in NED frame"]
24458 pub vy: f32,
24459 #[doc = "Z velocity in NED frame"]
24460 pub vz: f32,
24461 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24462 pub afx: f32,
24463 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24464 pub afy: f32,
24465 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24466 pub afz: f32,
24467 #[doc = "yaw setpoint"]
24468 pub yaw: f32,
24469 #[doc = "yaw rate setpoint"]
24470 pub yaw_rate: f32,
24471 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24472 pub type_mask: PositionTargetTypemask,
24473 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
24474 pub coordinate_frame: MavFrame,
24475}
24476impl POSITION_TARGET_GLOBAL_INT_DATA {
24477 pub const ENCODED_LEN: usize = 51usize;
24478 pub const DEFAULT: Self = Self {
24479 time_boot_ms: 0_u32,
24480 lat_int: 0_i32,
24481 lon_int: 0_i32,
24482 alt: 0.0_f32,
24483 vx: 0.0_f32,
24484 vy: 0.0_f32,
24485 vz: 0.0_f32,
24486 afx: 0.0_f32,
24487 afy: 0.0_f32,
24488 afz: 0.0_f32,
24489 yaw: 0.0_f32,
24490 yaw_rate: 0.0_f32,
24491 type_mask: PositionTargetTypemask::DEFAULT,
24492 coordinate_frame: MavFrame::DEFAULT,
24493 };
24494 #[cfg(feature = "arbitrary")]
24495 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24496 use arbitrary::{Arbitrary, Unstructured};
24497 let mut buf = [0u8; 1024];
24498 rng.fill_bytes(&mut buf);
24499 let mut unstructured = Unstructured::new(&buf);
24500 Self::arbitrary(&mut unstructured).unwrap_or_default()
24501 }
24502}
24503impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
24504 fn default() -> Self {
24505 Self::DEFAULT.clone()
24506 }
24507}
24508impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
24509 type Message = MavMessage;
24510 const ID: u32 = 87u32;
24511 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
24512 const EXTRA_CRC: u8 = 150u8;
24513 const ENCODED_LEN: usize = 51usize;
24514 fn deser(
24515 _version: MavlinkVersion,
24516 __input: &[u8],
24517 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24518 let avail_len = __input.len();
24519 let mut payload_buf = [0; Self::ENCODED_LEN];
24520 let mut buf = if avail_len < Self::ENCODED_LEN {
24521 payload_buf[0..avail_len].copy_from_slice(__input);
24522 Bytes::new(&payload_buf)
24523 } else {
24524 Bytes::new(__input)
24525 };
24526 let mut __struct = Self::default();
24527 __struct.time_boot_ms = buf.get_u32_le();
24528 __struct.lat_int = buf.get_i32_le();
24529 __struct.lon_int = buf.get_i32_le();
24530 __struct.alt = buf.get_f32_le();
24531 __struct.vx = buf.get_f32_le();
24532 __struct.vy = buf.get_f32_le();
24533 __struct.vz = buf.get_f32_le();
24534 __struct.afx = buf.get_f32_le();
24535 __struct.afy = buf.get_f32_le();
24536 __struct.afz = buf.get_f32_le();
24537 __struct.yaw = buf.get_f32_le();
24538 __struct.yaw_rate = buf.get_f32_le();
24539 let tmp = buf.get_u16_le();
24540 __struct.type_mask =
24541 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
24542 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24543 flag_type: "PositionTargetTypemask",
24544 value: tmp as u64,
24545 })?;
24546 let tmp = buf.get_u8();
24547 __struct.coordinate_frame =
24548 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24549 enum_type: "MavFrame",
24550 value: tmp as u64,
24551 })?;
24552 Ok(__struct)
24553 }
24554 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24555 let mut __tmp = BytesMut::new(bytes);
24556 #[allow(clippy::absurd_extreme_comparisons)]
24557 #[allow(unused_comparisons)]
24558 if __tmp.remaining() < Self::ENCODED_LEN {
24559 panic!(
24560 "buffer is too small (need {} bytes, but got {})",
24561 Self::ENCODED_LEN,
24562 __tmp.remaining(),
24563 )
24564 }
24565 __tmp.put_u32_le(self.time_boot_ms);
24566 __tmp.put_i32_le(self.lat_int);
24567 __tmp.put_i32_le(self.lon_int);
24568 __tmp.put_f32_le(self.alt);
24569 __tmp.put_f32_le(self.vx);
24570 __tmp.put_f32_le(self.vy);
24571 __tmp.put_f32_le(self.vz);
24572 __tmp.put_f32_le(self.afx);
24573 __tmp.put_f32_le(self.afy);
24574 __tmp.put_f32_le(self.afz);
24575 __tmp.put_f32_le(self.yaw);
24576 __tmp.put_f32_le(self.yaw_rate);
24577 __tmp.put_u16_le(self.type_mask.bits() as u16);
24578 __tmp.put_u8(self.coordinate_frame as u8);
24579 if matches!(version, MavlinkVersion::V2) {
24580 let len = __tmp.len();
24581 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24582 } else {
24583 __tmp.len()
24584 }
24585 }
24586}
24587#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
24588#[doc = ""]
24589#[doc = "ID: 85"]
24590#[derive(Debug, Clone, PartialEq)]
24591#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24592#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24593#[cfg_attr(feature = "ts", derive(TS))]
24594#[cfg_attr(feature = "ts", ts(export))]
24595pub struct POSITION_TARGET_LOCAL_NED_DATA {
24596 #[doc = "Timestamp (time since system boot)."]
24597 pub time_boot_ms: u32,
24598 #[doc = "X Position in NED frame"]
24599 pub x: f32,
24600 #[doc = "Y Position in NED frame"]
24601 pub y: f32,
24602 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
24603 pub z: f32,
24604 #[doc = "X velocity in NED frame"]
24605 pub vx: f32,
24606 #[doc = "Y velocity in NED frame"]
24607 pub vy: f32,
24608 #[doc = "Z velocity in NED frame"]
24609 pub vz: f32,
24610 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24611 pub afx: f32,
24612 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24613 pub afy: f32,
24614 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24615 pub afz: f32,
24616 #[doc = "yaw setpoint"]
24617 pub yaw: f32,
24618 #[doc = "yaw rate setpoint"]
24619 pub yaw_rate: f32,
24620 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24621 pub type_mask: PositionTargetTypemask,
24622 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
24623 pub coordinate_frame: MavFrame,
24624}
24625impl POSITION_TARGET_LOCAL_NED_DATA {
24626 pub const ENCODED_LEN: usize = 51usize;
24627 pub const DEFAULT: Self = Self {
24628 time_boot_ms: 0_u32,
24629 x: 0.0_f32,
24630 y: 0.0_f32,
24631 z: 0.0_f32,
24632 vx: 0.0_f32,
24633 vy: 0.0_f32,
24634 vz: 0.0_f32,
24635 afx: 0.0_f32,
24636 afy: 0.0_f32,
24637 afz: 0.0_f32,
24638 yaw: 0.0_f32,
24639 yaw_rate: 0.0_f32,
24640 type_mask: PositionTargetTypemask::DEFAULT,
24641 coordinate_frame: MavFrame::DEFAULT,
24642 };
24643 #[cfg(feature = "arbitrary")]
24644 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24645 use arbitrary::{Arbitrary, Unstructured};
24646 let mut buf = [0u8; 1024];
24647 rng.fill_bytes(&mut buf);
24648 let mut unstructured = Unstructured::new(&buf);
24649 Self::arbitrary(&mut unstructured).unwrap_or_default()
24650 }
24651}
24652impl Default for POSITION_TARGET_LOCAL_NED_DATA {
24653 fn default() -> Self {
24654 Self::DEFAULT.clone()
24655 }
24656}
24657impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
24658 type Message = MavMessage;
24659 const ID: u32 = 85u32;
24660 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
24661 const EXTRA_CRC: u8 = 140u8;
24662 const ENCODED_LEN: usize = 51usize;
24663 fn deser(
24664 _version: MavlinkVersion,
24665 __input: &[u8],
24666 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24667 let avail_len = __input.len();
24668 let mut payload_buf = [0; Self::ENCODED_LEN];
24669 let mut buf = if avail_len < Self::ENCODED_LEN {
24670 payload_buf[0..avail_len].copy_from_slice(__input);
24671 Bytes::new(&payload_buf)
24672 } else {
24673 Bytes::new(__input)
24674 };
24675 let mut __struct = Self::default();
24676 __struct.time_boot_ms = buf.get_u32_le();
24677 __struct.x = buf.get_f32_le();
24678 __struct.y = buf.get_f32_le();
24679 __struct.z = buf.get_f32_le();
24680 __struct.vx = buf.get_f32_le();
24681 __struct.vy = buf.get_f32_le();
24682 __struct.vz = buf.get_f32_le();
24683 __struct.afx = buf.get_f32_le();
24684 __struct.afy = buf.get_f32_le();
24685 __struct.afz = buf.get_f32_le();
24686 __struct.yaw = buf.get_f32_le();
24687 __struct.yaw_rate = buf.get_f32_le();
24688 let tmp = buf.get_u16_le();
24689 __struct.type_mask =
24690 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
24691 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24692 flag_type: "PositionTargetTypemask",
24693 value: tmp as u64,
24694 })?;
24695 let tmp = buf.get_u8();
24696 __struct.coordinate_frame =
24697 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24698 enum_type: "MavFrame",
24699 value: tmp as u64,
24700 })?;
24701 Ok(__struct)
24702 }
24703 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24704 let mut __tmp = BytesMut::new(bytes);
24705 #[allow(clippy::absurd_extreme_comparisons)]
24706 #[allow(unused_comparisons)]
24707 if __tmp.remaining() < Self::ENCODED_LEN {
24708 panic!(
24709 "buffer is too small (need {} bytes, but got {})",
24710 Self::ENCODED_LEN,
24711 __tmp.remaining(),
24712 )
24713 }
24714 __tmp.put_u32_le(self.time_boot_ms);
24715 __tmp.put_f32_le(self.x);
24716 __tmp.put_f32_le(self.y);
24717 __tmp.put_f32_le(self.z);
24718 __tmp.put_f32_le(self.vx);
24719 __tmp.put_f32_le(self.vy);
24720 __tmp.put_f32_le(self.vz);
24721 __tmp.put_f32_le(self.afx);
24722 __tmp.put_f32_le(self.afy);
24723 __tmp.put_f32_le(self.afz);
24724 __tmp.put_f32_le(self.yaw);
24725 __tmp.put_f32_le(self.yaw_rate);
24726 __tmp.put_u16_le(self.type_mask.bits() as u16);
24727 __tmp.put_u8(self.coordinate_frame as u8);
24728 if matches!(version, MavlinkVersion::V2) {
24729 let len = __tmp.len();
24730 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24731 } else {
24732 __tmp.len()
24733 }
24734 }
24735}
24736#[doc = "Power supply status."]
24737#[doc = ""]
24738#[doc = "ID: 125"]
24739#[derive(Debug, Clone, PartialEq)]
24740#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24741#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24742#[cfg_attr(feature = "ts", derive(TS))]
24743#[cfg_attr(feature = "ts", ts(export))]
24744pub struct POWER_STATUS_DATA {
24745 #[doc = "5V rail voltage."]
24746 pub Vcc: u16,
24747 #[doc = "Servo rail voltage."]
24748 pub Vservo: u16,
24749 #[doc = "Bitmap of power supply status flags."]
24750 pub flags: MavPowerStatus,
24751}
24752impl POWER_STATUS_DATA {
24753 pub const ENCODED_LEN: usize = 6usize;
24754 pub const DEFAULT: Self = Self {
24755 Vcc: 0_u16,
24756 Vservo: 0_u16,
24757 flags: MavPowerStatus::DEFAULT,
24758 };
24759 #[cfg(feature = "arbitrary")]
24760 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24761 use arbitrary::{Arbitrary, Unstructured};
24762 let mut buf = [0u8; 1024];
24763 rng.fill_bytes(&mut buf);
24764 let mut unstructured = Unstructured::new(&buf);
24765 Self::arbitrary(&mut unstructured).unwrap_or_default()
24766 }
24767}
24768impl Default for POWER_STATUS_DATA {
24769 fn default() -> Self {
24770 Self::DEFAULT.clone()
24771 }
24772}
24773impl MessageData for POWER_STATUS_DATA {
24774 type Message = MavMessage;
24775 const ID: u32 = 125u32;
24776 const NAME: &'static str = "POWER_STATUS";
24777 const EXTRA_CRC: u8 = 203u8;
24778 const ENCODED_LEN: usize = 6usize;
24779 fn deser(
24780 _version: MavlinkVersion,
24781 __input: &[u8],
24782 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24783 let avail_len = __input.len();
24784 let mut payload_buf = [0; Self::ENCODED_LEN];
24785 let mut buf = if avail_len < Self::ENCODED_LEN {
24786 payload_buf[0..avail_len].copy_from_slice(__input);
24787 Bytes::new(&payload_buf)
24788 } else {
24789 Bytes::new(__input)
24790 };
24791 let mut __struct = Self::default();
24792 __struct.Vcc = buf.get_u16_le();
24793 __struct.Vservo = buf.get_u16_le();
24794 let tmp = buf.get_u16_le();
24795 __struct.flags = MavPowerStatus::from_bits(tmp as <MavPowerStatus as Flags>::Bits).ok_or(
24796 ::mavlink_core::error::ParserError::InvalidFlag {
24797 flag_type: "MavPowerStatus",
24798 value: tmp as u64,
24799 },
24800 )?;
24801 Ok(__struct)
24802 }
24803 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24804 let mut __tmp = BytesMut::new(bytes);
24805 #[allow(clippy::absurd_extreme_comparisons)]
24806 #[allow(unused_comparisons)]
24807 if __tmp.remaining() < Self::ENCODED_LEN {
24808 panic!(
24809 "buffer is too small (need {} bytes, but got {})",
24810 Self::ENCODED_LEN,
24811 __tmp.remaining(),
24812 )
24813 }
24814 __tmp.put_u16_le(self.Vcc);
24815 __tmp.put_u16_le(self.Vservo);
24816 __tmp.put_u16_le(self.flags.bits() as u16);
24817 if matches!(version, MavlinkVersion::V2) {
24818 let len = __tmp.len();
24819 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24820 } else {
24821 __tmp.len()
24822 }
24823 }
24824}
24825#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
24826#[doc = ""]
24827#[doc = "ID: 300"]
24828#[derive(Debug, Clone, PartialEq)]
24829#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24830#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24831#[cfg_attr(feature = "ts", derive(TS))]
24832#[cfg_attr(feature = "ts", ts(export))]
24833pub struct PROTOCOL_VERSION_DATA {
24834 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
24835 pub version: u16,
24836 #[doc = "Minimum MAVLink version supported"]
24837 pub min_version: u16,
24838 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
24839 pub max_version: u16,
24840 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24841 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24842 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24843 pub spec_version_hash: [u8; 8],
24844 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24845 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24846 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24847 pub library_version_hash: [u8; 8],
24848}
24849impl PROTOCOL_VERSION_DATA {
24850 pub const ENCODED_LEN: usize = 22usize;
24851 pub const DEFAULT: Self = Self {
24852 version: 0_u16,
24853 min_version: 0_u16,
24854 max_version: 0_u16,
24855 spec_version_hash: [0_u8; 8usize],
24856 library_version_hash: [0_u8; 8usize],
24857 };
24858 #[cfg(feature = "arbitrary")]
24859 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24860 use arbitrary::{Arbitrary, Unstructured};
24861 let mut buf = [0u8; 1024];
24862 rng.fill_bytes(&mut buf);
24863 let mut unstructured = Unstructured::new(&buf);
24864 Self::arbitrary(&mut unstructured).unwrap_or_default()
24865 }
24866}
24867impl Default for PROTOCOL_VERSION_DATA {
24868 fn default() -> Self {
24869 Self::DEFAULT.clone()
24870 }
24871}
24872impl MessageData for PROTOCOL_VERSION_DATA {
24873 type Message = MavMessage;
24874 const ID: u32 = 300u32;
24875 const NAME: &'static str = "PROTOCOL_VERSION";
24876 const EXTRA_CRC: u8 = 217u8;
24877 const ENCODED_LEN: usize = 22usize;
24878 fn deser(
24879 _version: MavlinkVersion,
24880 __input: &[u8],
24881 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24882 let avail_len = __input.len();
24883 let mut payload_buf = [0; Self::ENCODED_LEN];
24884 let mut buf = if avail_len < Self::ENCODED_LEN {
24885 payload_buf[0..avail_len].copy_from_slice(__input);
24886 Bytes::new(&payload_buf)
24887 } else {
24888 Bytes::new(__input)
24889 };
24890 let mut __struct = Self::default();
24891 __struct.version = buf.get_u16_le();
24892 __struct.min_version = buf.get_u16_le();
24893 __struct.max_version = buf.get_u16_le();
24894 for v in &mut __struct.spec_version_hash {
24895 let val = buf.get_u8();
24896 *v = val;
24897 }
24898 for v in &mut __struct.library_version_hash {
24899 let val = buf.get_u8();
24900 *v = val;
24901 }
24902 Ok(__struct)
24903 }
24904 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24905 let mut __tmp = BytesMut::new(bytes);
24906 #[allow(clippy::absurd_extreme_comparisons)]
24907 #[allow(unused_comparisons)]
24908 if __tmp.remaining() < Self::ENCODED_LEN {
24909 panic!(
24910 "buffer is too small (need {} bytes, but got {})",
24911 Self::ENCODED_LEN,
24912 __tmp.remaining(),
24913 )
24914 }
24915 __tmp.put_u16_le(self.version);
24916 __tmp.put_u16_le(self.min_version);
24917 __tmp.put_u16_le(self.max_version);
24918 for val in &self.spec_version_hash {
24919 __tmp.put_u8(*val);
24920 }
24921 for val in &self.library_version_hash {
24922 __tmp.put_u8(*val);
24923 }
24924 if matches!(version, MavlinkVersion::V2) {
24925 let len = __tmp.len();
24926 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24927 } else {
24928 __tmp.len()
24929 }
24930 }
24931}
24932#[doc = "Complete set of calibration parameters for the radio."]
24933#[doc = ""]
24934#[doc = "ID: 221"]
24935#[derive(Debug, Clone, PartialEq)]
24936#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24937#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24938#[cfg_attr(feature = "ts", derive(TS))]
24939#[cfg_attr(feature = "ts", ts(export))]
24940pub struct RADIO_CALIBRATION_DATA {
24941 #[doc = "Aileron setpoints: left, center, right"]
24942 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24943 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24944 pub aileron: [u16; 3],
24945 #[doc = "Elevator setpoints: nose down, center, nose up"]
24946 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24947 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24948 pub elevator: [u16; 3],
24949 #[doc = "Rudder setpoints: nose left, center, nose right"]
24950 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24951 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24952 pub rudder: [u16; 3],
24953 #[doc = "Tail gyro mode/gain setpoints: heading hold, rate mode"]
24954 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24955 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24956 pub gyro: [u16; 2],
24957 #[doc = "Pitch curve setpoints (every 25%)"]
24958 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24959 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24960 pub pitch: [u16; 5],
24961 #[doc = "Throttle curve setpoints (every 25%)"]
24962 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24963 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24964 pub throttle: [u16; 5],
24965}
24966impl RADIO_CALIBRATION_DATA {
24967 pub const ENCODED_LEN: usize = 42usize;
24968 pub const DEFAULT: Self = Self {
24969 aileron: [0_u16; 3usize],
24970 elevator: [0_u16; 3usize],
24971 rudder: [0_u16; 3usize],
24972 gyro: [0_u16; 2usize],
24973 pitch: [0_u16; 5usize],
24974 throttle: [0_u16; 5usize],
24975 };
24976 #[cfg(feature = "arbitrary")]
24977 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24978 use arbitrary::{Arbitrary, Unstructured};
24979 let mut buf = [0u8; 1024];
24980 rng.fill_bytes(&mut buf);
24981 let mut unstructured = Unstructured::new(&buf);
24982 Self::arbitrary(&mut unstructured).unwrap_or_default()
24983 }
24984}
24985impl Default for RADIO_CALIBRATION_DATA {
24986 fn default() -> Self {
24987 Self::DEFAULT.clone()
24988 }
24989}
24990impl MessageData for RADIO_CALIBRATION_DATA {
24991 type Message = MavMessage;
24992 const ID: u32 = 221u32;
24993 const NAME: &'static str = "RADIO_CALIBRATION";
24994 const EXTRA_CRC: u8 = 71u8;
24995 const ENCODED_LEN: usize = 42usize;
24996 fn deser(
24997 _version: MavlinkVersion,
24998 __input: &[u8],
24999 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25000 let avail_len = __input.len();
25001 let mut payload_buf = [0; Self::ENCODED_LEN];
25002 let mut buf = if avail_len < Self::ENCODED_LEN {
25003 payload_buf[0..avail_len].copy_from_slice(__input);
25004 Bytes::new(&payload_buf)
25005 } else {
25006 Bytes::new(__input)
25007 };
25008 let mut __struct = Self::default();
25009 for v in &mut __struct.aileron {
25010 let val = buf.get_u16_le();
25011 *v = val;
25012 }
25013 for v in &mut __struct.elevator {
25014 let val = buf.get_u16_le();
25015 *v = val;
25016 }
25017 for v in &mut __struct.rudder {
25018 let val = buf.get_u16_le();
25019 *v = val;
25020 }
25021 for v in &mut __struct.gyro {
25022 let val = buf.get_u16_le();
25023 *v = val;
25024 }
25025 for v in &mut __struct.pitch {
25026 let val = buf.get_u16_le();
25027 *v = val;
25028 }
25029 for v in &mut __struct.throttle {
25030 let val = buf.get_u16_le();
25031 *v = val;
25032 }
25033 Ok(__struct)
25034 }
25035 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25036 let mut __tmp = BytesMut::new(bytes);
25037 #[allow(clippy::absurd_extreme_comparisons)]
25038 #[allow(unused_comparisons)]
25039 if __tmp.remaining() < Self::ENCODED_LEN {
25040 panic!(
25041 "buffer is too small (need {} bytes, but got {})",
25042 Self::ENCODED_LEN,
25043 __tmp.remaining(),
25044 )
25045 }
25046 for val in &self.aileron {
25047 __tmp.put_u16_le(*val);
25048 }
25049 for val in &self.elevator {
25050 __tmp.put_u16_le(*val);
25051 }
25052 for val in &self.rudder {
25053 __tmp.put_u16_le(*val);
25054 }
25055 for val in &self.gyro {
25056 __tmp.put_u16_le(*val);
25057 }
25058 for val in &self.pitch {
25059 __tmp.put_u16_le(*val);
25060 }
25061 for val in &self.throttle {
25062 __tmp.put_u16_le(*val);
25063 }
25064 if matches!(version, MavlinkVersion::V2) {
25065 let len = __tmp.len();
25066 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25067 } else {
25068 __tmp.len()
25069 }
25070 }
25071}
25072#[doc = "Status generated by radio and injected into MAVLink stream."]
25073#[doc = ""]
25074#[doc = "ID: 109"]
25075#[derive(Debug, Clone, PartialEq)]
25076#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25077#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25078#[cfg_attr(feature = "ts", derive(TS))]
25079#[cfg_attr(feature = "ts", ts(export))]
25080pub struct RADIO_STATUS_DATA {
25081 #[doc = "Count of radio packet receive errors (since boot)."]
25082 pub rxerrors: u16,
25083 #[doc = "Count of error corrected radio packets (since boot)."]
25084 pub fixed: u16,
25085 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25086 pub rssi: u8,
25087 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25088 pub remrssi: u8,
25089 #[doc = "Remaining free transmitter buffer space."]
25090 pub txbuf: u8,
25091 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25092 pub noise: u8,
25093 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25094 pub remnoise: u8,
25095}
25096impl RADIO_STATUS_DATA {
25097 pub const ENCODED_LEN: usize = 9usize;
25098 pub const DEFAULT: Self = Self {
25099 rxerrors: 0_u16,
25100 fixed: 0_u16,
25101 rssi: 0_u8,
25102 remrssi: 0_u8,
25103 txbuf: 0_u8,
25104 noise: 0_u8,
25105 remnoise: 0_u8,
25106 };
25107 #[cfg(feature = "arbitrary")]
25108 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25109 use arbitrary::{Arbitrary, Unstructured};
25110 let mut buf = [0u8; 1024];
25111 rng.fill_bytes(&mut buf);
25112 let mut unstructured = Unstructured::new(&buf);
25113 Self::arbitrary(&mut unstructured).unwrap_or_default()
25114 }
25115}
25116impl Default for RADIO_STATUS_DATA {
25117 fn default() -> Self {
25118 Self::DEFAULT.clone()
25119 }
25120}
25121impl MessageData for RADIO_STATUS_DATA {
25122 type Message = MavMessage;
25123 const ID: u32 = 109u32;
25124 const NAME: &'static str = "RADIO_STATUS";
25125 const EXTRA_CRC: u8 = 185u8;
25126 const ENCODED_LEN: usize = 9usize;
25127 fn deser(
25128 _version: MavlinkVersion,
25129 __input: &[u8],
25130 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25131 let avail_len = __input.len();
25132 let mut payload_buf = [0; Self::ENCODED_LEN];
25133 let mut buf = if avail_len < Self::ENCODED_LEN {
25134 payload_buf[0..avail_len].copy_from_slice(__input);
25135 Bytes::new(&payload_buf)
25136 } else {
25137 Bytes::new(__input)
25138 };
25139 let mut __struct = Self::default();
25140 __struct.rxerrors = buf.get_u16_le();
25141 __struct.fixed = buf.get_u16_le();
25142 __struct.rssi = buf.get_u8();
25143 __struct.remrssi = buf.get_u8();
25144 __struct.txbuf = buf.get_u8();
25145 __struct.noise = buf.get_u8();
25146 __struct.remnoise = buf.get_u8();
25147 Ok(__struct)
25148 }
25149 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25150 let mut __tmp = BytesMut::new(bytes);
25151 #[allow(clippy::absurd_extreme_comparisons)]
25152 #[allow(unused_comparisons)]
25153 if __tmp.remaining() < Self::ENCODED_LEN {
25154 panic!(
25155 "buffer is too small (need {} bytes, but got {})",
25156 Self::ENCODED_LEN,
25157 __tmp.remaining(),
25158 )
25159 }
25160 __tmp.put_u16_le(self.rxerrors);
25161 __tmp.put_u16_le(self.fixed);
25162 __tmp.put_u8(self.rssi);
25163 __tmp.put_u8(self.remrssi);
25164 __tmp.put_u8(self.txbuf);
25165 __tmp.put_u8(self.noise);
25166 __tmp.put_u8(self.remnoise);
25167 if matches!(version, MavlinkVersion::V2) {
25168 let len = __tmp.len();
25169 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25170 } else {
25171 __tmp.len()
25172 }
25173 }
25174}
25175#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
25176#[doc = ""]
25177#[doc = "ID: 27"]
25178#[derive(Debug, Clone, PartialEq)]
25179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25180#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25181#[cfg_attr(feature = "ts", derive(TS))]
25182#[cfg_attr(feature = "ts", ts(export))]
25183pub struct RAW_IMU_DATA {
25184 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25185 pub time_usec: u64,
25186 #[doc = "X acceleration (raw)"]
25187 pub xacc: i16,
25188 #[doc = "Y acceleration (raw)"]
25189 pub yacc: i16,
25190 #[doc = "Z acceleration (raw)"]
25191 pub zacc: i16,
25192 #[doc = "Angular speed around X axis (raw)"]
25193 pub xgyro: i16,
25194 #[doc = "Angular speed around Y axis (raw)"]
25195 pub ygyro: i16,
25196 #[doc = "Angular speed around Z axis (raw)"]
25197 pub zgyro: i16,
25198 #[doc = "X Magnetic field (raw)"]
25199 pub xmag: i16,
25200 #[doc = "Y Magnetic field (raw)"]
25201 pub ymag: i16,
25202 #[doc = "Z Magnetic field (raw)"]
25203 pub zmag: i16,
25204 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
25205 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25206 pub id: u8,
25207 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25208 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25209 pub temperature: i16,
25210}
25211impl RAW_IMU_DATA {
25212 pub const ENCODED_LEN: usize = 29usize;
25213 pub const DEFAULT: Self = Self {
25214 time_usec: 0_u64,
25215 xacc: 0_i16,
25216 yacc: 0_i16,
25217 zacc: 0_i16,
25218 xgyro: 0_i16,
25219 ygyro: 0_i16,
25220 zgyro: 0_i16,
25221 xmag: 0_i16,
25222 ymag: 0_i16,
25223 zmag: 0_i16,
25224 id: 0_u8,
25225 temperature: 0_i16,
25226 };
25227 #[cfg(feature = "arbitrary")]
25228 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25229 use arbitrary::{Arbitrary, Unstructured};
25230 let mut buf = [0u8; 1024];
25231 rng.fill_bytes(&mut buf);
25232 let mut unstructured = Unstructured::new(&buf);
25233 Self::arbitrary(&mut unstructured).unwrap_or_default()
25234 }
25235}
25236impl Default for RAW_IMU_DATA {
25237 fn default() -> Self {
25238 Self::DEFAULT.clone()
25239 }
25240}
25241impl MessageData for RAW_IMU_DATA {
25242 type Message = MavMessage;
25243 const ID: u32 = 27u32;
25244 const NAME: &'static str = "RAW_IMU";
25245 const EXTRA_CRC: u8 = 144u8;
25246 const ENCODED_LEN: usize = 29usize;
25247 fn deser(
25248 _version: MavlinkVersion,
25249 __input: &[u8],
25250 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25251 let avail_len = __input.len();
25252 let mut payload_buf = [0; Self::ENCODED_LEN];
25253 let mut buf = if avail_len < Self::ENCODED_LEN {
25254 payload_buf[0..avail_len].copy_from_slice(__input);
25255 Bytes::new(&payload_buf)
25256 } else {
25257 Bytes::new(__input)
25258 };
25259 let mut __struct = Self::default();
25260 __struct.time_usec = buf.get_u64_le();
25261 __struct.xacc = buf.get_i16_le();
25262 __struct.yacc = buf.get_i16_le();
25263 __struct.zacc = buf.get_i16_le();
25264 __struct.xgyro = buf.get_i16_le();
25265 __struct.ygyro = buf.get_i16_le();
25266 __struct.zgyro = buf.get_i16_le();
25267 __struct.xmag = buf.get_i16_le();
25268 __struct.ymag = buf.get_i16_le();
25269 __struct.zmag = buf.get_i16_le();
25270 __struct.id = buf.get_u8();
25271 __struct.temperature = buf.get_i16_le();
25272 Ok(__struct)
25273 }
25274 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25275 let mut __tmp = BytesMut::new(bytes);
25276 #[allow(clippy::absurd_extreme_comparisons)]
25277 #[allow(unused_comparisons)]
25278 if __tmp.remaining() < Self::ENCODED_LEN {
25279 panic!(
25280 "buffer is too small (need {} bytes, but got {})",
25281 Self::ENCODED_LEN,
25282 __tmp.remaining(),
25283 )
25284 }
25285 __tmp.put_u64_le(self.time_usec);
25286 __tmp.put_i16_le(self.xacc);
25287 __tmp.put_i16_le(self.yacc);
25288 __tmp.put_i16_le(self.zacc);
25289 __tmp.put_i16_le(self.xgyro);
25290 __tmp.put_i16_le(self.ygyro);
25291 __tmp.put_i16_le(self.zgyro);
25292 __tmp.put_i16_le(self.xmag);
25293 __tmp.put_i16_le(self.ymag);
25294 __tmp.put_i16_le(self.zmag);
25295 if matches!(version, MavlinkVersion::V2) {
25296 __tmp.put_u8(self.id);
25297 __tmp.put_i16_le(self.temperature);
25298 let len = __tmp.len();
25299 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25300 } else {
25301 __tmp.len()
25302 }
25303 }
25304}
25305#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
25306#[doc = ""]
25307#[doc = "ID: 28"]
25308#[derive(Debug, Clone, PartialEq)]
25309#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25310#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25311#[cfg_attr(feature = "ts", derive(TS))]
25312#[cfg_attr(feature = "ts", ts(export))]
25313pub struct RAW_PRESSURE_DATA {
25314 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25315 pub time_usec: u64,
25316 #[doc = "Absolute pressure (raw)"]
25317 pub press_abs: i16,
25318 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
25319 pub press_diff1: i16,
25320 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
25321 pub press_diff2: i16,
25322 #[doc = "Raw Temperature measurement (raw)"]
25323 pub temperature: i16,
25324}
25325impl RAW_PRESSURE_DATA {
25326 pub const ENCODED_LEN: usize = 16usize;
25327 pub const DEFAULT: Self = Self {
25328 time_usec: 0_u64,
25329 press_abs: 0_i16,
25330 press_diff1: 0_i16,
25331 press_diff2: 0_i16,
25332 temperature: 0_i16,
25333 };
25334 #[cfg(feature = "arbitrary")]
25335 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25336 use arbitrary::{Arbitrary, Unstructured};
25337 let mut buf = [0u8; 1024];
25338 rng.fill_bytes(&mut buf);
25339 let mut unstructured = Unstructured::new(&buf);
25340 Self::arbitrary(&mut unstructured).unwrap_or_default()
25341 }
25342}
25343impl Default for RAW_PRESSURE_DATA {
25344 fn default() -> Self {
25345 Self::DEFAULT.clone()
25346 }
25347}
25348impl MessageData for RAW_PRESSURE_DATA {
25349 type Message = MavMessage;
25350 const ID: u32 = 28u32;
25351 const NAME: &'static str = "RAW_PRESSURE";
25352 const EXTRA_CRC: u8 = 67u8;
25353 const ENCODED_LEN: usize = 16usize;
25354 fn deser(
25355 _version: MavlinkVersion,
25356 __input: &[u8],
25357 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25358 let avail_len = __input.len();
25359 let mut payload_buf = [0; Self::ENCODED_LEN];
25360 let mut buf = if avail_len < Self::ENCODED_LEN {
25361 payload_buf[0..avail_len].copy_from_slice(__input);
25362 Bytes::new(&payload_buf)
25363 } else {
25364 Bytes::new(__input)
25365 };
25366 let mut __struct = Self::default();
25367 __struct.time_usec = buf.get_u64_le();
25368 __struct.press_abs = buf.get_i16_le();
25369 __struct.press_diff1 = buf.get_i16_le();
25370 __struct.press_diff2 = buf.get_i16_le();
25371 __struct.temperature = buf.get_i16_le();
25372 Ok(__struct)
25373 }
25374 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25375 let mut __tmp = BytesMut::new(bytes);
25376 #[allow(clippy::absurd_extreme_comparisons)]
25377 #[allow(unused_comparisons)]
25378 if __tmp.remaining() < Self::ENCODED_LEN {
25379 panic!(
25380 "buffer is too small (need {} bytes, but got {})",
25381 Self::ENCODED_LEN,
25382 __tmp.remaining(),
25383 )
25384 }
25385 __tmp.put_u64_le(self.time_usec);
25386 __tmp.put_i16_le(self.press_abs);
25387 __tmp.put_i16_le(self.press_diff1);
25388 __tmp.put_i16_le(self.press_diff2);
25389 __tmp.put_i16_le(self.temperature);
25390 if matches!(version, MavlinkVersion::V2) {
25391 let len = __tmp.len();
25392 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25393 } else {
25394 __tmp.len()
25395 }
25396 }
25397}
25398#[doc = "RPM sensor data message."]
25399#[doc = ""]
25400#[doc = "ID: 339"]
25401#[derive(Debug, Clone, PartialEq)]
25402#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25403#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25404#[cfg_attr(feature = "ts", derive(TS))]
25405#[cfg_attr(feature = "ts", ts(export))]
25406pub struct RAW_RPM_DATA {
25407 #[doc = "Indicated rate"]
25408 pub frequency: f32,
25409 #[doc = "Index of this RPM sensor (0-indexed)"]
25410 pub index: u8,
25411}
25412impl RAW_RPM_DATA {
25413 pub const ENCODED_LEN: usize = 5usize;
25414 pub const DEFAULT: Self = Self {
25415 frequency: 0.0_f32,
25416 index: 0_u8,
25417 };
25418 #[cfg(feature = "arbitrary")]
25419 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25420 use arbitrary::{Arbitrary, Unstructured};
25421 let mut buf = [0u8; 1024];
25422 rng.fill_bytes(&mut buf);
25423 let mut unstructured = Unstructured::new(&buf);
25424 Self::arbitrary(&mut unstructured).unwrap_or_default()
25425 }
25426}
25427impl Default for RAW_RPM_DATA {
25428 fn default() -> Self {
25429 Self::DEFAULT.clone()
25430 }
25431}
25432impl MessageData for RAW_RPM_DATA {
25433 type Message = MavMessage;
25434 const ID: u32 = 339u32;
25435 const NAME: &'static str = "RAW_RPM";
25436 const EXTRA_CRC: u8 = 199u8;
25437 const ENCODED_LEN: usize = 5usize;
25438 fn deser(
25439 _version: MavlinkVersion,
25440 __input: &[u8],
25441 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25442 let avail_len = __input.len();
25443 let mut payload_buf = [0; Self::ENCODED_LEN];
25444 let mut buf = if avail_len < Self::ENCODED_LEN {
25445 payload_buf[0..avail_len].copy_from_slice(__input);
25446 Bytes::new(&payload_buf)
25447 } else {
25448 Bytes::new(__input)
25449 };
25450 let mut __struct = Self::default();
25451 __struct.frequency = buf.get_f32_le();
25452 __struct.index = buf.get_u8();
25453 Ok(__struct)
25454 }
25455 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25456 let mut __tmp = BytesMut::new(bytes);
25457 #[allow(clippy::absurd_extreme_comparisons)]
25458 #[allow(unused_comparisons)]
25459 if __tmp.remaining() < Self::ENCODED_LEN {
25460 panic!(
25461 "buffer is too small (need {} bytes, but got {})",
25462 Self::ENCODED_LEN,
25463 __tmp.remaining(),
25464 )
25465 }
25466 __tmp.put_f32_le(self.frequency);
25467 __tmp.put_u8(self.index);
25468 if matches!(version, MavlinkVersion::V2) {
25469 let len = __tmp.len();
25470 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25471 } else {
25472 __tmp.len()
25473 }
25474 }
25475}
25476#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25477#[doc = ""]
25478#[doc = "ID: 65"]
25479#[derive(Debug, Clone, PartialEq)]
25480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25481#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25482#[cfg_attr(feature = "ts", derive(TS))]
25483#[cfg_attr(feature = "ts", ts(export))]
25484pub struct RC_CHANNELS_DATA {
25485 #[doc = "Timestamp (time since system boot)."]
25486 pub time_boot_ms: u32,
25487 #[doc = "RC channel 1 value."]
25488 pub chan1_raw: u16,
25489 #[doc = "RC channel 2 value."]
25490 pub chan2_raw: u16,
25491 #[doc = "RC channel 3 value."]
25492 pub chan3_raw: u16,
25493 #[doc = "RC channel 4 value."]
25494 pub chan4_raw: u16,
25495 #[doc = "RC channel 5 value."]
25496 pub chan5_raw: u16,
25497 #[doc = "RC channel 6 value."]
25498 pub chan6_raw: u16,
25499 #[doc = "RC channel 7 value."]
25500 pub chan7_raw: u16,
25501 #[doc = "RC channel 8 value."]
25502 pub chan8_raw: u16,
25503 #[doc = "RC channel 9 value."]
25504 pub chan9_raw: u16,
25505 #[doc = "RC channel 10 value."]
25506 pub chan10_raw: u16,
25507 #[doc = "RC channel 11 value."]
25508 pub chan11_raw: u16,
25509 #[doc = "RC channel 12 value."]
25510 pub chan12_raw: u16,
25511 #[doc = "RC channel 13 value."]
25512 pub chan13_raw: u16,
25513 #[doc = "RC channel 14 value."]
25514 pub chan14_raw: u16,
25515 #[doc = "RC channel 15 value."]
25516 pub chan15_raw: u16,
25517 #[doc = "RC channel 16 value."]
25518 pub chan16_raw: u16,
25519 #[doc = "RC channel 17 value."]
25520 pub chan17_raw: u16,
25521 #[doc = "RC channel 18 value."]
25522 pub chan18_raw: u16,
25523 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
25524 pub chancount: u8,
25525 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25526 pub rssi: u8,
25527}
25528impl RC_CHANNELS_DATA {
25529 pub const ENCODED_LEN: usize = 42usize;
25530 pub const DEFAULT: Self = Self {
25531 time_boot_ms: 0_u32,
25532 chan1_raw: 0_u16,
25533 chan2_raw: 0_u16,
25534 chan3_raw: 0_u16,
25535 chan4_raw: 0_u16,
25536 chan5_raw: 0_u16,
25537 chan6_raw: 0_u16,
25538 chan7_raw: 0_u16,
25539 chan8_raw: 0_u16,
25540 chan9_raw: 0_u16,
25541 chan10_raw: 0_u16,
25542 chan11_raw: 0_u16,
25543 chan12_raw: 0_u16,
25544 chan13_raw: 0_u16,
25545 chan14_raw: 0_u16,
25546 chan15_raw: 0_u16,
25547 chan16_raw: 0_u16,
25548 chan17_raw: 0_u16,
25549 chan18_raw: 0_u16,
25550 chancount: 0_u8,
25551 rssi: 0_u8,
25552 };
25553 #[cfg(feature = "arbitrary")]
25554 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25555 use arbitrary::{Arbitrary, Unstructured};
25556 let mut buf = [0u8; 1024];
25557 rng.fill_bytes(&mut buf);
25558 let mut unstructured = Unstructured::new(&buf);
25559 Self::arbitrary(&mut unstructured).unwrap_or_default()
25560 }
25561}
25562impl Default for RC_CHANNELS_DATA {
25563 fn default() -> Self {
25564 Self::DEFAULT.clone()
25565 }
25566}
25567impl MessageData for RC_CHANNELS_DATA {
25568 type Message = MavMessage;
25569 const ID: u32 = 65u32;
25570 const NAME: &'static str = "RC_CHANNELS";
25571 const EXTRA_CRC: u8 = 118u8;
25572 const ENCODED_LEN: usize = 42usize;
25573 fn deser(
25574 _version: MavlinkVersion,
25575 __input: &[u8],
25576 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25577 let avail_len = __input.len();
25578 let mut payload_buf = [0; Self::ENCODED_LEN];
25579 let mut buf = if avail_len < Self::ENCODED_LEN {
25580 payload_buf[0..avail_len].copy_from_slice(__input);
25581 Bytes::new(&payload_buf)
25582 } else {
25583 Bytes::new(__input)
25584 };
25585 let mut __struct = Self::default();
25586 __struct.time_boot_ms = buf.get_u32_le();
25587 __struct.chan1_raw = buf.get_u16_le();
25588 __struct.chan2_raw = buf.get_u16_le();
25589 __struct.chan3_raw = buf.get_u16_le();
25590 __struct.chan4_raw = buf.get_u16_le();
25591 __struct.chan5_raw = buf.get_u16_le();
25592 __struct.chan6_raw = buf.get_u16_le();
25593 __struct.chan7_raw = buf.get_u16_le();
25594 __struct.chan8_raw = buf.get_u16_le();
25595 __struct.chan9_raw = buf.get_u16_le();
25596 __struct.chan10_raw = buf.get_u16_le();
25597 __struct.chan11_raw = buf.get_u16_le();
25598 __struct.chan12_raw = buf.get_u16_le();
25599 __struct.chan13_raw = buf.get_u16_le();
25600 __struct.chan14_raw = buf.get_u16_le();
25601 __struct.chan15_raw = buf.get_u16_le();
25602 __struct.chan16_raw = buf.get_u16_le();
25603 __struct.chan17_raw = buf.get_u16_le();
25604 __struct.chan18_raw = buf.get_u16_le();
25605 __struct.chancount = buf.get_u8();
25606 __struct.rssi = buf.get_u8();
25607 Ok(__struct)
25608 }
25609 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25610 let mut __tmp = BytesMut::new(bytes);
25611 #[allow(clippy::absurd_extreme_comparisons)]
25612 #[allow(unused_comparisons)]
25613 if __tmp.remaining() < Self::ENCODED_LEN {
25614 panic!(
25615 "buffer is too small (need {} bytes, but got {})",
25616 Self::ENCODED_LEN,
25617 __tmp.remaining(),
25618 )
25619 }
25620 __tmp.put_u32_le(self.time_boot_ms);
25621 __tmp.put_u16_le(self.chan1_raw);
25622 __tmp.put_u16_le(self.chan2_raw);
25623 __tmp.put_u16_le(self.chan3_raw);
25624 __tmp.put_u16_le(self.chan4_raw);
25625 __tmp.put_u16_le(self.chan5_raw);
25626 __tmp.put_u16_le(self.chan6_raw);
25627 __tmp.put_u16_le(self.chan7_raw);
25628 __tmp.put_u16_le(self.chan8_raw);
25629 __tmp.put_u16_le(self.chan9_raw);
25630 __tmp.put_u16_le(self.chan10_raw);
25631 __tmp.put_u16_le(self.chan11_raw);
25632 __tmp.put_u16_le(self.chan12_raw);
25633 __tmp.put_u16_le(self.chan13_raw);
25634 __tmp.put_u16_le(self.chan14_raw);
25635 __tmp.put_u16_le(self.chan15_raw);
25636 __tmp.put_u16_le(self.chan16_raw);
25637 __tmp.put_u16_le(self.chan17_raw);
25638 __tmp.put_u16_le(self.chan18_raw);
25639 __tmp.put_u8(self.chancount);
25640 __tmp.put_u8(self.rssi);
25641 if matches!(version, MavlinkVersion::V2) {
25642 let len = __tmp.len();
25643 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25644 } else {
25645 __tmp.len()
25646 }
25647 }
25648}
25649#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
25650#[doc = ""]
25651#[doc = "ID: 70"]
25652#[derive(Debug, Clone, PartialEq)]
25653#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25654#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25655#[cfg_attr(feature = "ts", derive(TS))]
25656#[cfg_attr(feature = "ts", ts(export))]
25657pub struct RC_CHANNELS_OVERRIDE_DATA {
25658 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25659 pub chan1_raw: u16,
25660 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25661 pub chan2_raw: u16,
25662 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25663 pub chan3_raw: u16,
25664 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25665 pub chan4_raw: u16,
25666 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25667 pub chan5_raw: u16,
25668 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25669 pub chan6_raw: u16,
25670 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25671 pub chan7_raw: u16,
25672 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25673 pub chan8_raw: u16,
25674 #[doc = "System ID"]
25675 pub target_system: u8,
25676 #[doc = "Component ID"]
25677 pub target_component: u8,
25678 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25679 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25680 pub chan9_raw: u16,
25681 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25682 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25683 pub chan10_raw: u16,
25684 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25685 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25686 pub chan11_raw: u16,
25687 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25688 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25689 pub chan12_raw: u16,
25690 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25691 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25692 pub chan13_raw: u16,
25693 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25694 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25695 pub chan14_raw: u16,
25696 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25697 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25698 pub chan15_raw: u16,
25699 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25700 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25701 pub chan16_raw: u16,
25702 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25703 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25704 pub chan17_raw: u16,
25705 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25706 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25707 pub chan18_raw: u16,
25708}
25709impl RC_CHANNELS_OVERRIDE_DATA {
25710 pub const ENCODED_LEN: usize = 38usize;
25711 pub const DEFAULT: Self = Self {
25712 chan1_raw: 0_u16,
25713 chan2_raw: 0_u16,
25714 chan3_raw: 0_u16,
25715 chan4_raw: 0_u16,
25716 chan5_raw: 0_u16,
25717 chan6_raw: 0_u16,
25718 chan7_raw: 0_u16,
25719 chan8_raw: 0_u16,
25720 target_system: 0_u8,
25721 target_component: 0_u8,
25722 chan9_raw: 0_u16,
25723 chan10_raw: 0_u16,
25724 chan11_raw: 0_u16,
25725 chan12_raw: 0_u16,
25726 chan13_raw: 0_u16,
25727 chan14_raw: 0_u16,
25728 chan15_raw: 0_u16,
25729 chan16_raw: 0_u16,
25730 chan17_raw: 0_u16,
25731 chan18_raw: 0_u16,
25732 };
25733 #[cfg(feature = "arbitrary")]
25734 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25735 use arbitrary::{Arbitrary, Unstructured};
25736 let mut buf = [0u8; 1024];
25737 rng.fill_bytes(&mut buf);
25738 let mut unstructured = Unstructured::new(&buf);
25739 Self::arbitrary(&mut unstructured).unwrap_or_default()
25740 }
25741}
25742impl Default for RC_CHANNELS_OVERRIDE_DATA {
25743 fn default() -> Self {
25744 Self::DEFAULT.clone()
25745 }
25746}
25747impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
25748 type Message = MavMessage;
25749 const ID: u32 = 70u32;
25750 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
25751 const EXTRA_CRC: u8 = 124u8;
25752 const ENCODED_LEN: usize = 38usize;
25753 fn deser(
25754 _version: MavlinkVersion,
25755 __input: &[u8],
25756 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25757 let avail_len = __input.len();
25758 let mut payload_buf = [0; Self::ENCODED_LEN];
25759 let mut buf = if avail_len < Self::ENCODED_LEN {
25760 payload_buf[0..avail_len].copy_from_slice(__input);
25761 Bytes::new(&payload_buf)
25762 } else {
25763 Bytes::new(__input)
25764 };
25765 let mut __struct = Self::default();
25766 __struct.chan1_raw = buf.get_u16_le();
25767 __struct.chan2_raw = buf.get_u16_le();
25768 __struct.chan3_raw = buf.get_u16_le();
25769 __struct.chan4_raw = buf.get_u16_le();
25770 __struct.chan5_raw = buf.get_u16_le();
25771 __struct.chan6_raw = buf.get_u16_le();
25772 __struct.chan7_raw = buf.get_u16_le();
25773 __struct.chan8_raw = buf.get_u16_le();
25774 __struct.target_system = buf.get_u8();
25775 __struct.target_component = buf.get_u8();
25776 __struct.chan9_raw = buf.get_u16_le();
25777 __struct.chan10_raw = buf.get_u16_le();
25778 __struct.chan11_raw = buf.get_u16_le();
25779 __struct.chan12_raw = buf.get_u16_le();
25780 __struct.chan13_raw = buf.get_u16_le();
25781 __struct.chan14_raw = buf.get_u16_le();
25782 __struct.chan15_raw = buf.get_u16_le();
25783 __struct.chan16_raw = buf.get_u16_le();
25784 __struct.chan17_raw = buf.get_u16_le();
25785 __struct.chan18_raw = buf.get_u16_le();
25786 Ok(__struct)
25787 }
25788 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25789 let mut __tmp = BytesMut::new(bytes);
25790 #[allow(clippy::absurd_extreme_comparisons)]
25791 #[allow(unused_comparisons)]
25792 if __tmp.remaining() < Self::ENCODED_LEN {
25793 panic!(
25794 "buffer is too small (need {} bytes, but got {})",
25795 Self::ENCODED_LEN,
25796 __tmp.remaining(),
25797 )
25798 }
25799 __tmp.put_u16_le(self.chan1_raw);
25800 __tmp.put_u16_le(self.chan2_raw);
25801 __tmp.put_u16_le(self.chan3_raw);
25802 __tmp.put_u16_le(self.chan4_raw);
25803 __tmp.put_u16_le(self.chan5_raw);
25804 __tmp.put_u16_le(self.chan6_raw);
25805 __tmp.put_u16_le(self.chan7_raw);
25806 __tmp.put_u16_le(self.chan8_raw);
25807 __tmp.put_u8(self.target_system);
25808 __tmp.put_u8(self.target_component);
25809 if matches!(version, MavlinkVersion::V2) {
25810 __tmp.put_u16_le(self.chan9_raw);
25811 __tmp.put_u16_le(self.chan10_raw);
25812 __tmp.put_u16_le(self.chan11_raw);
25813 __tmp.put_u16_le(self.chan12_raw);
25814 __tmp.put_u16_le(self.chan13_raw);
25815 __tmp.put_u16_le(self.chan14_raw);
25816 __tmp.put_u16_le(self.chan15_raw);
25817 __tmp.put_u16_le(self.chan16_raw);
25818 __tmp.put_u16_le(self.chan17_raw);
25819 __tmp.put_u16_le(self.chan18_raw);
25820 let len = __tmp.len();
25821 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25822 } else {
25823 __tmp.len()
25824 }
25825 }
25826}
25827#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25828#[doc = ""]
25829#[doc = "ID: 35"]
25830#[derive(Debug, Clone, PartialEq)]
25831#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25832#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25833#[cfg_attr(feature = "ts", derive(TS))]
25834#[cfg_attr(feature = "ts", ts(export))]
25835pub struct RC_CHANNELS_RAW_DATA {
25836 #[doc = "Timestamp (time since system boot)."]
25837 pub time_boot_ms: u32,
25838 #[doc = "RC channel 1 value."]
25839 pub chan1_raw: u16,
25840 #[doc = "RC channel 2 value."]
25841 pub chan2_raw: u16,
25842 #[doc = "RC channel 3 value."]
25843 pub chan3_raw: u16,
25844 #[doc = "RC channel 4 value."]
25845 pub chan4_raw: u16,
25846 #[doc = "RC channel 5 value."]
25847 pub chan5_raw: u16,
25848 #[doc = "RC channel 6 value."]
25849 pub chan6_raw: u16,
25850 #[doc = "RC channel 7 value."]
25851 pub chan7_raw: u16,
25852 #[doc = "RC channel 8 value."]
25853 pub chan8_raw: u16,
25854 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25855 pub port: u8,
25856 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25857 pub rssi: u8,
25858}
25859impl RC_CHANNELS_RAW_DATA {
25860 pub const ENCODED_LEN: usize = 22usize;
25861 pub const DEFAULT: Self = Self {
25862 time_boot_ms: 0_u32,
25863 chan1_raw: 0_u16,
25864 chan2_raw: 0_u16,
25865 chan3_raw: 0_u16,
25866 chan4_raw: 0_u16,
25867 chan5_raw: 0_u16,
25868 chan6_raw: 0_u16,
25869 chan7_raw: 0_u16,
25870 chan8_raw: 0_u16,
25871 port: 0_u8,
25872 rssi: 0_u8,
25873 };
25874 #[cfg(feature = "arbitrary")]
25875 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25876 use arbitrary::{Arbitrary, Unstructured};
25877 let mut buf = [0u8; 1024];
25878 rng.fill_bytes(&mut buf);
25879 let mut unstructured = Unstructured::new(&buf);
25880 Self::arbitrary(&mut unstructured).unwrap_or_default()
25881 }
25882}
25883impl Default for RC_CHANNELS_RAW_DATA {
25884 fn default() -> Self {
25885 Self::DEFAULT.clone()
25886 }
25887}
25888impl MessageData for RC_CHANNELS_RAW_DATA {
25889 type Message = MavMessage;
25890 const ID: u32 = 35u32;
25891 const NAME: &'static str = "RC_CHANNELS_RAW";
25892 const EXTRA_CRC: u8 = 244u8;
25893 const ENCODED_LEN: usize = 22usize;
25894 fn deser(
25895 _version: MavlinkVersion,
25896 __input: &[u8],
25897 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25898 let avail_len = __input.len();
25899 let mut payload_buf = [0; Self::ENCODED_LEN];
25900 let mut buf = if avail_len < Self::ENCODED_LEN {
25901 payload_buf[0..avail_len].copy_from_slice(__input);
25902 Bytes::new(&payload_buf)
25903 } else {
25904 Bytes::new(__input)
25905 };
25906 let mut __struct = Self::default();
25907 __struct.time_boot_ms = buf.get_u32_le();
25908 __struct.chan1_raw = buf.get_u16_le();
25909 __struct.chan2_raw = buf.get_u16_le();
25910 __struct.chan3_raw = buf.get_u16_le();
25911 __struct.chan4_raw = buf.get_u16_le();
25912 __struct.chan5_raw = buf.get_u16_le();
25913 __struct.chan6_raw = buf.get_u16_le();
25914 __struct.chan7_raw = buf.get_u16_le();
25915 __struct.chan8_raw = buf.get_u16_le();
25916 __struct.port = buf.get_u8();
25917 __struct.rssi = buf.get_u8();
25918 Ok(__struct)
25919 }
25920 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25921 let mut __tmp = BytesMut::new(bytes);
25922 #[allow(clippy::absurd_extreme_comparisons)]
25923 #[allow(unused_comparisons)]
25924 if __tmp.remaining() < Self::ENCODED_LEN {
25925 panic!(
25926 "buffer is too small (need {} bytes, but got {})",
25927 Self::ENCODED_LEN,
25928 __tmp.remaining(),
25929 )
25930 }
25931 __tmp.put_u32_le(self.time_boot_ms);
25932 __tmp.put_u16_le(self.chan1_raw);
25933 __tmp.put_u16_le(self.chan2_raw);
25934 __tmp.put_u16_le(self.chan3_raw);
25935 __tmp.put_u16_le(self.chan4_raw);
25936 __tmp.put_u16_le(self.chan5_raw);
25937 __tmp.put_u16_le(self.chan6_raw);
25938 __tmp.put_u16_le(self.chan7_raw);
25939 __tmp.put_u16_le(self.chan8_raw);
25940 __tmp.put_u8(self.port);
25941 __tmp.put_u8(self.rssi);
25942 if matches!(version, MavlinkVersion::V2) {
25943 let len = __tmp.len();
25944 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25945 } else {
25946 __tmp.len()
25947 }
25948 }
25949}
25950#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
25951#[doc = ""]
25952#[doc = "ID: 34"]
25953#[derive(Debug, Clone, PartialEq)]
25954#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25955#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25956#[cfg_attr(feature = "ts", derive(TS))]
25957#[cfg_attr(feature = "ts", ts(export))]
25958pub struct RC_CHANNELS_SCALED_DATA {
25959 #[doc = "Timestamp (time since system boot)."]
25960 pub time_boot_ms: u32,
25961 #[doc = "RC channel 1 value scaled."]
25962 pub chan1_scaled: i16,
25963 #[doc = "RC channel 2 value scaled."]
25964 pub chan2_scaled: i16,
25965 #[doc = "RC channel 3 value scaled."]
25966 pub chan3_scaled: i16,
25967 #[doc = "RC channel 4 value scaled."]
25968 pub chan4_scaled: i16,
25969 #[doc = "RC channel 5 value scaled."]
25970 pub chan5_scaled: i16,
25971 #[doc = "RC channel 6 value scaled."]
25972 pub chan6_scaled: i16,
25973 #[doc = "RC channel 7 value scaled."]
25974 pub chan7_scaled: i16,
25975 #[doc = "RC channel 8 value scaled."]
25976 pub chan8_scaled: i16,
25977 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25978 pub port: u8,
25979 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25980 pub rssi: u8,
25981}
25982impl RC_CHANNELS_SCALED_DATA {
25983 pub const ENCODED_LEN: usize = 22usize;
25984 pub const DEFAULT: Self = Self {
25985 time_boot_ms: 0_u32,
25986 chan1_scaled: 0_i16,
25987 chan2_scaled: 0_i16,
25988 chan3_scaled: 0_i16,
25989 chan4_scaled: 0_i16,
25990 chan5_scaled: 0_i16,
25991 chan6_scaled: 0_i16,
25992 chan7_scaled: 0_i16,
25993 chan8_scaled: 0_i16,
25994 port: 0_u8,
25995 rssi: 0_u8,
25996 };
25997 #[cfg(feature = "arbitrary")]
25998 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25999 use arbitrary::{Arbitrary, Unstructured};
26000 let mut buf = [0u8; 1024];
26001 rng.fill_bytes(&mut buf);
26002 let mut unstructured = Unstructured::new(&buf);
26003 Self::arbitrary(&mut unstructured).unwrap_or_default()
26004 }
26005}
26006impl Default for RC_CHANNELS_SCALED_DATA {
26007 fn default() -> Self {
26008 Self::DEFAULT.clone()
26009 }
26010}
26011impl MessageData for RC_CHANNELS_SCALED_DATA {
26012 type Message = MavMessage;
26013 const ID: u32 = 34u32;
26014 const NAME: &'static str = "RC_CHANNELS_SCALED";
26015 const EXTRA_CRC: u8 = 237u8;
26016 const ENCODED_LEN: usize = 22usize;
26017 fn deser(
26018 _version: MavlinkVersion,
26019 __input: &[u8],
26020 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26021 let avail_len = __input.len();
26022 let mut payload_buf = [0; Self::ENCODED_LEN];
26023 let mut buf = if avail_len < Self::ENCODED_LEN {
26024 payload_buf[0..avail_len].copy_from_slice(__input);
26025 Bytes::new(&payload_buf)
26026 } else {
26027 Bytes::new(__input)
26028 };
26029 let mut __struct = Self::default();
26030 __struct.time_boot_ms = buf.get_u32_le();
26031 __struct.chan1_scaled = buf.get_i16_le();
26032 __struct.chan2_scaled = buf.get_i16_le();
26033 __struct.chan3_scaled = buf.get_i16_le();
26034 __struct.chan4_scaled = buf.get_i16_le();
26035 __struct.chan5_scaled = buf.get_i16_le();
26036 __struct.chan6_scaled = buf.get_i16_le();
26037 __struct.chan7_scaled = buf.get_i16_le();
26038 __struct.chan8_scaled = buf.get_i16_le();
26039 __struct.port = buf.get_u8();
26040 __struct.rssi = buf.get_u8();
26041 Ok(__struct)
26042 }
26043 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26044 let mut __tmp = BytesMut::new(bytes);
26045 #[allow(clippy::absurd_extreme_comparisons)]
26046 #[allow(unused_comparisons)]
26047 if __tmp.remaining() < Self::ENCODED_LEN {
26048 panic!(
26049 "buffer is too small (need {} bytes, but got {})",
26050 Self::ENCODED_LEN,
26051 __tmp.remaining(),
26052 )
26053 }
26054 __tmp.put_u32_le(self.time_boot_ms);
26055 __tmp.put_i16_le(self.chan1_scaled);
26056 __tmp.put_i16_le(self.chan2_scaled);
26057 __tmp.put_i16_le(self.chan3_scaled);
26058 __tmp.put_i16_le(self.chan4_scaled);
26059 __tmp.put_i16_le(self.chan5_scaled);
26060 __tmp.put_i16_le(self.chan6_scaled);
26061 __tmp.put_i16_le(self.chan7_scaled);
26062 __tmp.put_i16_le(self.chan8_scaled);
26063 __tmp.put_u8(self.port);
26064 __tmp.put_u8(self.rssi);
26065 if matches!(version, MavlinkVersion::V2) {
26066 let len = __tmp.len();
26067 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26068 } else {
26069 __tmp.len()
26070 }
26071 }
26072}
26073#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
26074#[doc = "Request a data stream."]
26075#[doc = ""]
26076#[doc = "ID: 66"]
26077#[derive(Debug, Clone, PartialEq)]
26078#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26080#[cfg_attr(feature = "ts", derive(TS))]
26081#[cfg_attr(feature = "ts", ts(export))]
26082pub struct REQUEST_DATA_STREAM_DATA {
26083 #[doc = "The requested message rate"]
26084 pub req_message_rate: u16,
26085 #[doc = "The target requested to send the message stream."]
26086 pub target_system: u8,
26087 #[doc = "The target requested to send the message stream."]
26088 pub target_component: u8,
26089 #[doc = "The ID of the requested data stream"]
26090 pub req_stream_id: u8,
26091 #[doc = "1 to start sending, 0 to stop sending."]
26092 pub start_stop: u8,
26093}
26094impl REQUEST_DATA_STREAM_DATA {
26095 pub const ENCODED_LEN: usize = 6usize;
26096 pub const DEFAULT: Self = Self {
26097 req_message_rate: 0_u16,
26098 target_system: 0_u8,
26099 target_component: 0_u8,
26100 req_stream_id: 0_u8,
26101 start_stop: 0_u8,
26102 };
26103 #[cfg(feature = "arbitrary")]
26104 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26105 use arbitrary::{Arbitrary, Unstructured};
26106 let mut buf = [0u8; 1024];
26107 rng.fill_bytes(&mut buf);
26108 let mut unstructured = Unstructured::new(&buf);
26109 Self::arbitrary(&mut unstructured).unwrap_or_default()
26110 }
26111}
26112impl Default for REQUEST_DATA_STREAM_DATA {
26113 fn default() -> Self {
26114 Self::DEFAULT.clone()
26115 }
26116}
26117impl MessageData for REQUEST_DATA_STREAM_DATA {
26118 type Message = MavMessage;
26119 const ID: u32 = 66u32;
26120 const NAME: &'static str = "REQUEST_DATA_STREAM";
26121 const EXTRA_CRC: u8 = 148u8;
26122 const ENCODED_LEN: usize = 6usize;
26123 fn deser(
26124 _version: MavlinkVersion,
26125 __input: &[u8],
26126 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26127 let avail_len = __input.len();
26128 let mut payload_buf = [0; Self::ENCODED_LEN];
26129 let mut buf = if avail_len < Self::ENCODED_LEN {
26130 payload_buf[0..avail_len].copy_from_slice(__input);
26131 Bytes::new(&payload_buf)
26132 } else {
26133 Bytes::new(__input)
26134 };
26135 let mut __struct = Self::default();
26136 __struct.req_message_rate = buf.get_u16_le();
26137 __struct.target_system = buf.get_u8();
26138 __struct.target_component = buf.get_u8();
26139 __struct.req_stream_id = buf.get_u8();
26140 __struct.start_stop = buf.get_u8();
26141 Ok(__struct)
26142 }
26143 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26144 let mut __tmp = BytesMut::new(bytes);
26145 #[allow(clippy::absurd_extreme_comparisons)]
26146 #[allow(unused_comparisons)]
26147 if __tmp.remaining() < Self::ENCODED_LEN {
26148 panic!(
26149 "buffer is too small (need {} bytes, but got {})",
26150 Self::ENCODED_LEN,
26151 __tmp.remaining(),
26152 )
26153 }
26154 __tmp.put_u16_le(self.req_message_rate);
26155 __tmp.put_u8(self.target_system);
26156 __tmp.put_u8(self.target_component);
26157 __tmp.put_u8(self.req_stream_id);
26158 __tmp.put_u8(self.start_stop);
26159 if matches!(version, MavlinkVersion::V2) {
26160 let len = __tmp.len();
26161 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26162 } else {
26163 __tmp.len()
26164 }
26165 }
26166}
26167#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
26168#[doc = ""]
26169#[doc = "ID: 412"]
26170#[derive(Debug, Clone, PartialEq)]
26171#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26172#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26173#[cfg_attr(feature = "ts", derive(TS))]
26174#[cfg_attr(feature = "ts", ts(export))]
26175pub struct REQUEST_EVENT_DATA {
26176 #[doc = "First sequence number of the requested event."]
26177 pub first_sequence: u16,
26178 #[doc = "Last sequence number of the requested event."]
26179 pub last_sequence: u16,
26180 #[doc = "System ID"]
26181 pub target_system: u8,
26182 #[doc = "Component ID"]
26183 pub target_component: u8,
26184}
26185impl REQUEST_EVENT_DATA {
26186 pub const ENCODED_LEN: usize = 6usize;
26187 pub const DEFAULT: Self = Self {
26188 first_sequence: 0_u16,
26189 last_sequence: 0_u16,
26190 target_system: 0_u8,
26191 target_component: 0_u8,
26192 };
26193 #[cfg(feature = "arbitrary")]
26194 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26195 use arbitrary::{Arbitrary, Unstructured};
26196 let mut buf = [0u8; 1024];
26197 rng.fill_bytes(&mut buf);
26198 let mut unstructured = Unstructured::new(&buf);
26199 Self::arbitrary(&mut unstructured).unwrap_or_default()
26200 }
26201}
26202impl Default for REQUEST_EVENT_DATA {
26203 fn default() -> Self {
26204 Self::DEFAULT.clone()
26205 }
26206}
26207impl MessageData for REQUEST_EVENT_DATA {
26208 type Message = MavMessage;
26209 const ID: u32 = 412u32;
26210 const NAME: &'static str = "REQUEST_EVENT";
26211 const EXTRA_CRC: u8 = 33u8;
26212 const ENCODED_LEN: usize = 6usize;
26213 fn deser(
26214 _version: MavlinkVersion,
26215 __input: &[u8],
26216 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26217 let avail_len = __input.len();
26218 let mut payload_buf = [0; Self::ENCODED_LEN];
26219 let mut buf = if avail_len < Self::ENCODED_LEN {
26220 payload_buf[0..avail_len].copy_from_slice(__input);
26221 Bytes::new(&payload_buf)
26222 } else {
26223 Bytes::new(__input)
26224 };
26225 let mut __struct = Self::default();
26226 __struct.first_sequence = buf.get_u16_le();
26227 __struct.last_sequence = buf.get_u16_le();
26228 __struct.target_system = buf.get_u8();
26229 __struct.target_component = buf.get_u8();
26230 Ok(__struct)
26231 }
26232 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26233 let mut __tmp = BytesMut::new(bytes);
26234 #[allow(clippy::absurd_extreme_comparisons)]
26235 #[allow(unused_comparisons)]
26236 if __tmp.remaining() < Self::ENCODED_LEN {
26237 panic!(
26238 "buffer is too small (need {} bytes, but got {})",
26239 Self::ENCODED_LEN,
26240 __tmp.remaining(),
26241 )
26242 }
26243 __tmp.put_u16_le(self.first_sequence);
26244 __tmp.put_u16_le(self.last_sequence);
26245 __tmp.put_u8(self.target_system);
26246 __tmp.put_u8(self.target_component);
26247 if matches!(version, MavlinkVersion::V2) {
26248 let len = __tmp.len();
26249 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26250 } else {
26251 __tmp.len()
26252 }
26253 }
26254}
26255#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
26256#[doc = ""]
26257#[doc = "ID: 142"]
26258#[derive(Debug, Clone, PartialEq)]
26259#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26260#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26261#[cfg_attr(feature = "ts", derive(TS))]
26262#[cfg_attr(feature = "ts", ts(export))]
26263pub struct RESOURCE_REQUEST_DATA {
26264 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
26265 pub request_id: u8,
26266 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
26267 pub uri_type: u8,
26268 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
26269 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26270 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26271 pub uri: [u8; 120],
26272 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
26273 pub transfer_type: u8,
26274 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
26275 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26276 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26277 pub storage: [u8; 120],
26278}
26279impl RESOURCE_REQUEST_DATA {
26280 pub const ENCODED_LEN: usize = 243usize;
26281 pub const DEFAULT: Self = Self {
26282 request_id: 0_u8,
26283 uri_type: 0_u8,
26284 uri: [0_u8; 120usize],
26285 transfer_type: 0_u8,
26286 storage: [0_u8; 120usize],
26287 };
26288 #[cfg(feature = "arbitrary")]
26289 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26290 use arbitrary::{Arbitrary, Unstructured};
26291 let mut buf = [0u8; 1024];
26292 rng.fill_bytes(&mut buf);
26293 let mut unstructured = Unstructured::new(&buf);
26294 Self::arbitrary(&mut unstructured).unwrap_or_default()
26295 }
26296}
26297impl Default for RESOURCE_REQUEST_DATA {
26298 fn default() -> Self {
26299 Self::DEFAULT.clone()
26300 }
26301}
26302impl MessageData for RESOURCE_REQUEST_DATA {
26303 type Message = MavMessage;
26304 const ID: u32 = 142u32;
26305 const NAME: &'static str = "RESOURCE_REQUEST";
26306 const EXTRA_CRC: u8 = 72u8;
26307 const ENCODED_LEN: usize = 243usize;
26308 fn deser(
26309 _version: MavlinkVersion,
26310 __input: &[u8],
26311 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26312 let avail_len = __input.len();
26313 let mut payload_buf = [0; Self::ENCODED_LEN];
26314 let mut buf = if avail_len < Self::ENCODED_LEN {
26315 payload_buf[0..avail_len].copy_from_slice(__input);
26316 Bytes::new(&payload_buf)
26317 } else {
26318 Bytes::new(__input)
26319 };
26320 let mut __struct = Self::default();
26321 __struct.request_id = buf.get_u8();
26322 __struct.uri_type = buf.get_u8();
26323 for v in &mut __struct.uri {
26324 let val = buf.get_u8();
26325 *v = val;
26326 }
26327 __struct.transfer_type = buf.get_u8();
26328 for v in &mut __struct.storage {
26329 let val = buf.get_u8();
26330 *v = val;
26331 }
26332 Ok(__struct)
26333 }
26334 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26335 let mut __tmp = BytesMut::new(bytes);
26336 #[allow(clippy::absurd_extreme_comparisons)]
26337 #[allow(unused_comparisons)]
26338 if __tmp.remaining() < Self::ENCODED_LEN {
26339 panic!(
26340 "buffer is too small (need {} bytes, but got {})",
26341 Self::ENCODED_LEN,
26342 __tmp.remaining(),
26343 )
26344 }
26345 __tmp.put_u8(self.request_id);
26346 __tmp.put_u8(self.uri_type);
26347 for val in &self.uri {
26348 __tmp.put_u8(*val);
26349 }
26350 __tmp.put_u8(self.transfer_type);
26351 for val in &self.storage {
26352 __tmp.put_u8(*val);
26353 }
26354 if matches!(version, MavlinkVersion::V2) {
26355 let len = __tmp.len();
26356 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26357 } else {
26358 __tmp.len()
26359 }
26360 }
26361}
26362#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
26363#[doc = ""]
26364#[doc = "ID: 413"]
26365#[derive(Debug, Clone, PartialEq)]
26366#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26368#[cfg_attr(feature = "ts", derive(TS))]
26369#[cfg_attr(feature = "ts", ts(export))]
26370pub struct RESPONSE_EVENT_ERROR_DATA {
26371 #[doc = "Sequence number."]
26372 pub sequence: u16,
26373 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
26374 pub sequence_oldest_available: u16,
26375 #[doc = "System ID"]
26376 pub target_system: u8,
26377 #[doc = "Component ID"]
26378 pub target_component: u8,
26379 #[doc = "Error reason."]
26380 pub reason: MavEventErrorReason,
26381}
26382impl RESPONSE_EVENT_ERROR_DATA {
26383 pub const ENCODED_LEN: usize = 7usize;
26384 pub const DEFAULT: Self = Self {
26385 sequence: 0_u16,
26386 sequence_oldest_available: 0_u16,
26387 target_system: 0_u8,
26388 target_component: 0_u8,
26389 reason: MavEventErrorReason::DEFAULT,
26390 };
26391 #[cfg(feature = "arbitrary")]
26392 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26393 use arbitrary::{Arbitrary, Unstructured};
26394 let mut buf = [0u8; 1024];
26395 rng.fill_bytes(&mut buf);
26396 let mut unstructured = Unstructured::new(&buf);
26397 Self::arbitrary(&mut unstructured).unwrap_or_default()
26398 }
26399}
26400impl Default for RESPONSE_EVENT_ERROR_DATA {
26401 fn default() -> Self {
26402 Self::DEFAULT.clone()
26403 }
26404}
26405impl MessageData for RESPONSE_EVENT_ERROR_DATA {
26406 type Message = MavMessage;
26407 const ID: u32 = 413u32;
26408 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
26409 const EXTRA_CRC: u8 = 77u8;
26410 const ENCODED_LEN: usize = 7usize;
26411 fn deser(
26412 _version: MavlinkVersion,
26413 __input: &[u8],
26414 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26415 let avail_len = __input.len();
26416 let mut payload_buf = [0; Self::ENCODED_LEN];
26417 let mut buf = if avail_len < Self::ENCODED_LEN {
26418 payload_buf[0..avail_len].copy_from_slice(__input);
26419 Bytes::new(&payload_buf)
26420 } else {
26421 Bytes::new(__input)
26422 };
26423 let mut __struct = Self::default();
26424 __struct.sequence = buf.get_u16_le();
26425 __struct.sequence_oldest_available = buf.get_u16_le();
26426 __struct.target_system = buf.get_u8();
26427 __struct.target_component = buf.get_u8();
26428 let tmp = buf.get_u8();
26429 __struct.reason =
26430 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26431 enum_type: "MavEventErrorReason",
26432 value: tmp as u64,
26433 })?;
26434 Ok(__struct)
26435 }
26436 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26437 let mut __tmp = BytesMut::new(bytes);
26438 #[allow(clippy::absurd_extreme_comparisons)]
26439 #[allow(unused_comparisons)]
26440 if __tmp.remaining() < Self::ENCODED_LEN {
26441 panic!(
26442 "buffer is too small (need {} bytes, but got {})",
26443 Self::ENCODED_LEN,
26444 __tmp.remaining(),
26445 )
26446 }
26447 __tmp.put_u16_le(self.sequence);
26448 __tmp.put_u16_le(self.sequence_oldest_available);
26449 __tmp.put_u8(self.target_system);
26450 __tmp.put_u8(self.target_component);
26451 __tmp.put_u8(self.reason as u8);
26452 if matches!(version, MavlinkVersion::V2) {
26453 let len = __tmp.len();
26454 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26455 } else {
26456 __tmp.len()
26457 }
26458 }
26459}
26460#[doc = "Read out the safety zone the MAV currently assumes."]
26461#[doc = ""]
26462#[doc = "ID: 55"]
26463#[derive(Debug, Clone, PartialEq)]
26464#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26465#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26466#[cfg_attr(feature = "ts", derive(TS))]
26467#[cfg_attr(feature = "ts", ts(export))]
26468pub struct SAFETY_ALLOWED_AREA_DATA {
26469 #[doc = "x position 1 / Latitude 1"]
26470 pub p1x: f32,
26471 #[doc = "y position 1 / Longitude 1"]
26472 pub p1y: f32,
26473 #[doc = "z position 1 / Altitude 1"]
26474 pub p1z: f32,
26475 #[doc = "x position 2 / Latitude 2"]
26476 pub p2x: f32,
26477 #[doc = "y position 2 / Longitude 2"]
26478 pub p2y: f32,
26479 #[doc = "z position 2 / Altitude 2"]
26480 pub p2z: f32,
26481 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26482 pub frame: MavFrame,
26483}
26484impl SAFETY_ALLOWED_AREA_DATA {
26485 pub const ENCODED_LEN: usize = 25usize;
26486 pub const DEFAULT: Self = Self {
26487 p1x: 0.0_f32,
26488 p1y: 0.0_f32,
26489 p1z: 0.0_f32,
26490 p2x: 0.0_f32,
26491 p2y: 0.0_f32,
26492 p2z: 0.0_f32,
26493 frame: MavFrame::DEFAULT,
26494 };
26495 #[cfg(feature = "arbitrary")]
26496 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26497 use arbitrary::{Arbitrary, Unstructured};
26498 let mut buf = [0u8; 1024];
26499 rng.fill_bytes(&mut buf);
26500 let mut unstructured = Unstructured::new(&buf);
26501 Self::arbitrary(&mut unstructured).unwrap_or_default()
26502 }
26503}
26504impl Default for SAFETY_ALLOWED_AREA_DATA {
26505 fn default() -> Self {
26506 Self::DEFAULT.clone()
26507 }
26508}
26509impl MessageData for SAFETY_ALLOWED_AREA_DATA {
26510 type Message = MavMessage;
26511 const ID: u32 = 55u32;
26512 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
26513 const EXTRA_CRC: u8 = 3u8;
26514 const ENCODED_LEN: usize = 25usize;
26515 fn deser(
26516 _version: MavlinkVersion,
26517 __input: &[u8],
26518 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26519 let avail_len = __input.len();
26520 let mut payload_buf = [0; Self::ENCODED_LEN];
26521 let mut buf = if avail_len < Self::ENCODED_LEN {
26522 payload_buf[0..avail_len].copy_from_slice(__input);
26523 Bytes::new(&payload_buf)
26524 } else {
26525 Bytes::new(__input)
26526 };
26527 let mut __struct = Self::default();
26528 __struct.p1x = buf.get_f32_le();
26529 __struct.p1y = buf.get_f32_le();
26530 __struct.p1z = buf.get_f32_le();
26531 __struct.p2x = buf.get_f32_le();
26532 __struct.p2y = buf.get_f32_le();
26533 __struct.p2z = buf.get_f32_le();
26534 let tmp = buf.get_u8();
26535 __struct.frame =
26536 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26537 enum_type: "MavFrame",
26538 value: tmp as u64,
26539 })?;
26540 Ok(__struct)
26541 }
26542 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26543 let mut __tmp = BytesMut::new(bytes);
26544 #[allow(clippy::absurd_extreme_comparisons)]
26545 #[allow(unused_comparisons)]
26546 if __tmp.remaining() < Self::ENCODED_LEN {
26547 panic!(
26548 "buffer is too small (need {} bytes, but got {})",
26549 Self::ENCODED_LEN,
26550 __tmp.remaining(),
26551 )
26552 }
26553 __tmp.put_f32_le(self.p1x);
26554 __tmp.put_f32_le(self.p1y);
26555 __tmp.put_f32_le(self.p1z);
26556 __tmp.put_f32_le(self.p2x);
26557 __tmp.put_f32_le(self.p2y);
26558 __tmp.put_f32_le(self.p2z);
26559 __tmp.put_u8(self.frame as u8);
26560 if matches!(version, MavlinkVersion::V2) {
26561 let len = __tmp.len();
26562 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26563 } else {
26564 __tmp.len()
26565 }
26566 }
26567}
26568#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
26569#[doc = ""]
26570#[doc = "ID: 54"]
26571#[derive(Debug, Clone, PartialEq)]
26572#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26573#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26574#[cfg_attr(feature = "ts", derive(TS))]
26575#[cfg_attr(feature = "ts", ts(export))]
26576pub struct SAFETY_SET_ALLOWED_AREA_DATA {
26577 #[doc = "x position 1 / Latitude 1"]
26578 pub p1x: f32,
26579 #[doc = "y position 1 / Longitude 1"]
26580 pub p1y: f32,
26581 #[doc = "z position 1 / Altitude 1"]
26582 pub p1z: f32,
26583 #[doc = "x position 2 / Latitude 2"]
26584 pub p2x: f32,
26585 #[doc = "y position 2 / Longitude 2"]
26586 pub p2y: f32,
26587 #[doc = "z position 2 / Altitude 2"]
26588 pub p2z: f32,
26589 #[doc = "System ID"]
26590 pub target_system: u8,
26591 #[doc = "Component ID"]
26592 pub target_component: u8,
26593 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26594 pub frame: MavFrame,
26595}
26596impl SAFETY_SET_ALLOWED_AREA_DATA {
26597 pub const ENCODED_LEN: usize = 27usize;
26598 pub const DEFAULT: Self = Self {
26599 p1x: 0.0_f32,
26600 p1y: 0.0_f32,
26601 p1z: 0.0_f32,
26602 p2x: 0.0_f32,
26603 p2y: 0.0_f32,
26604 p2z: 0.0_f32,
26605 target_system: 0_u8,
26606 target_component: 0_u8,
26607 frame: MavFrame::DEFAULT,
26608 };
26609 #[cfg(feature = "arbitrary")]
26610 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26611 use arbitrary::{Arbitrary, Unstructured};
26612 let mut buf = [0u8; 1024];
26613 rng.fill_bytes(&mut buf);
26614 let mut unstructured = Unstructured::new(&buf);
26615 Self::arbitrary(&mut unstructured).unwrap_or_default()
26616 }
26617}
26618impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
26619 fn default() -> Self {
26620 Self::DEFAULT.clone()
26621 }
26622}
26623impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
26624 type Message = MavMessage;
26625 const ID: u32 = 54u32;
26626 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
26627 const EXTRA_CRC: u8 = 15u8;
26628 const ENCODED_LEN: usize = 27usize;
26629 fn deser(
26630 _version: MavlinkVersion,
26631 __input: &[u8],
26632 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26633 let avail_len = __input.len();
26634 let mut payload_buf = [0; Self::ENCODED_LEN];
26635 let mut buf = if avail_len < Self::ENCODED_LEN {
26636 payload_buf[0..avail_len].copy_from_slice(__input);
26637 Bytes::new(&payload_buf)
26638 } else {
26639 Bytes::new(__input)
26640 };
26641 let mut __struct = Self::default();
26642 __struct.p1x = buf.get_f32_le();
26643 __struct.p1y = buf.get_f32_le();
26644 __struct.p1z = buf.get_f32_le();
26645 __struct.p2x = buf.get_f32_le();
26646 __struct.p2y = buf.get_f32_le();
26647 __struct.p2z = buf.get_f32_le();
26648 __struct.target_system = buf.get_u8();
26649 __struct.target_component = buf.get_u8();
26650 let tmp = buf.get_u8();
26651 __struct.frame =
26652 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26653 enum_type: "MavFrame",
26654 value: tmp as u64,
26655 })?;
26656 Ok(__struct)
26657 }
26658 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26659 let mut __tmp = BytesMut::new(bytes);
26660 #[allow(clippy::absurd_extreme_comparisons)]
26661 #[allow(unused_comparisons)]
26662 if __tmp.remaining() < Self::ENCODED_LEN {
26663 panic!(
26664 "buffer is too small (need {} bytes, but got {})",
26665 Self::ENCODED_LEN,
26666 __tmp.remaining(),
26667 )
26668 }
26669 __tmp.put_f32_le(self.p1x);
26670 __tmp.put_f32_le(self.p1y);
26671 __tmp.put_f32_le(self.p1z);
26672 __tmp.put_f32_le(self.p2x);
26673 __tmp.put_f32_le(self.p2y);
26674 __tmp.put_f32_le(self.p2z);
26675 __tmp.put_u8(self.target_system);
26676 __tmp.put_u8(self.target_component);
26677 __tmp.put_u8(self.frame as u8);
26678 if matches!(version, MavlinkVersion::V2) {
26679 let len = __tmp.len();
26680 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26681 } else {
26682 __tmp.len()
26683 }
26684 }
26685}
26686#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
26687#[doc = ""]
26688#[doc = "ID: 26"]
26689#[derive(Debug, Clone, PartialEq)]
26690#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26691#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26692#[cfg_attr(feature = "ts", derive(TS))]
26693#[cfg_attr(feature = "ts", ts(export))]
26694pub struct SCALED_IMU_DATA {
26695 #[doc = "Timestamp (time since system boot)."]
26696 pub time_boot_ms: u32,
26697 #[doc = "X acceleration"]
26698 pub xacc: i16,
26699 #[doc = "Y acceleration"]
26700 pub yacc: i16,
26701 #[doc = "Z acceleration"]
26702 pub zacc: i16,
26703 #[doc = "Angular speed around X axis"]
26704 pub xgyro: i16,
26705 #[doc = "Angular speed around Y axis"]
26706 pub ygyro: i16,
26707 #[doc = "Angular speed around Z axis"]
26708 pub zgyro: i16,
26709 #[doc = "X Magnetic field"]
26710 pub xmag: i16,
26711 #[doc = "Y Magnetic field"]
26712 pub ymag: i16,
26713 #[doc = "Z Magnetic field"]
26714 pub zmag: i16,
26715 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26716 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26717 pub temperature: i16,
26718}
26719impl SCALED_IMU_DATA {
26720 pub const ENCODED_LEN: usize = 24usize;
26721 pub const DEFAULT: Self = Self {
26722 time_boot_ms: 0_u32,
26723 xacc: 0_i16,
26724 yacc: 0_i16,
26725 zacc: 0_i16,
26726 xgyro: 0_i16,
26727 ygyro: 0_i16,
26728 zgyro: 0_i16,
26729 xmag: 0_i16,
26730 ymag: 0_i16,
26731 zmag: 0_i16,
26732 temperature: 0_i16,
26733 };
26734 #[cfg(feature = "arbitrary")]
26735 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26736 use arbitrary::{Arbitrary, Unstructured};
26737 let mut buf = [0u8; 1024];
26738 rng.fill_bytes(&mut buf);
26739 let mut unstructured = Unstructured::new(&buf);
26740 Self::arbitrary(&mut unstructured).unwrap_or_default()
26741 }
26742}
26743impl Default for SCALED_IMU_DATA {
26744 fn default() -> Self {
26745 Self::DEFAULT.clone()
26746 }
26747}
26748impl MessageData for SCALED_IMU_DATA {
26749 type Message = MavMessage;
26750 const ID: u32 = 26u32;
26751 const NAME: &'static str = "SCALED_IMU";
26752 const EXTRA_CRC: u8 = 170u8;
26753 const ENCODED_LEN: usize = 24usize;
26754 fn deser(
26755 _version: MavlinkVersion,
26756 __input: &[u8],
26757 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26758 let avail_len = __input.len();
26759 let mut payload_buf = [0; Self::ENCODED_LEN];
26760 let mut buf = if avail_len < Self::ENCODED_LEN {
26761 payload_buf[0..avail_len].copy_from_slice(__input);
26762 Bytes::new(&payload_buf)
26763 } else {
26764 Bytes::new(__input)
26765 };
26766 let mut __struct = Self::default();
26767 __struct.time_boot_ms = buf.get_u32_le();
26768 __struct.xacc = buf.get_i16_le();
26769 __struct.yacc = buf.get_i16_le();
26770 __struct.zacc = buf.get_i16_le();
26771 __struct.xgyro = buf.get_i16_le();
26772 __struct.ygyro = buf.get_i16_le();
26773 __struct.zgyro = buf.get_i16_le();
26774 __struct.xmag = buf.get_i16_le();
26775 __struct.ymag = buf.get_i16_le();
26776 __struct.zmag = buf.get_i16_le();
26777 __struct.temperature = buf.get_i16_le();
26778 Ok(__struct)
26779 }
26780 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26781 let mut __tmp = BytesMut::new(bytes);
26782 #[allow(clippy::absurd_extreme_comparisons)]
26783 #[allow(unused_comparisons)]
26784 if __tmp.remaining() < Self::ENCODED_LEN {
26785 panic!(
26786 "buffer is too small (need {} bytes, but got {})",
26787 Self::ENCODED_LEN,
26788 __tmp.remaining(),
26789 )
26790 }
26791 __tmp.put_u32_le(self.time_boot_ms);
26792 __tmp.put_i16_le(self.xacc);
26793 __tmp.put_i16_le(self.yacc);
26794 __tmp.put_i16_le(self.zacc);
26795 __tmp.put_i16_le(self.xgyro);
26796 __tmp.put_i16_le(self.ygyro);
26797 __tmp.put_i16_le(self.zgyro);
26798 __tmp.put_i16_le(self.xmag);
26799 __tmp.put_i16_le(self.ymag);
26800 __tmp.put_i16_le(self.zmag);
26801 if matches!(version, MavlinkVersion::V2) {
26802 __tmp.put_i16_le(self.temperature);
26803 let len = __tmp.len();
26804 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26805 } else {
26806 __tmp.len()
26807 }
26808 }
26809}
26810#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
26811#[doc = ""]
26812#[doc = "ID: 116"]
26813#[derive(Debug, Clone, PartialEq)]
26814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26815#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26816#[cfg_attr(feature = "ts", derive(TS))]
26817#[cfg_attr(feature = "ts", ts(export))]
26818pub struct SCALED_IMU2_DATA {
26819 #[doc = "Timestamp (time since system boot)."]
26820 pub time_boot_ms: u32,
26821 #[doc = "X acceleration"]
26822 pub xacc: i16,
26823 #[doc = "Y acceleration"]
26824 pub yacc: i16,
26825 #[doc = "Z acceleration"]
26826 pub zacc: i16,
26827 #[doc = "Angular speed around X axis"]
26828 pub xgyro: i16,
26829 #[doc = "Angular speed around Y axis"]
26830 pub ygyro: i16,
26831 #[doc = "Angular speed around Z axis"]
26832 pub zgyro: i16,
26833 #[doc = "X Magnetic field"]
26834 pub xmag: i16,
26835 #[doc = "Y Magnetic field"]
26836 pub ymag: i16,
26837 #[doc = "Z Magnetic field"]
26838 pub zmag: i16,
26839 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26840 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26841 pub temperature: i16,
26842}
26843impl SCALED_IMU2_DATA {
26844 pub const ENCODED_LEN: usize = 24usize;
26845 pub const DEFAULT: Self = Self {
26846 time_boot_ms: 0_u32,
26847 xacc: 0_i16,
26848 yacc: 0_i16,
26849 zacc: 0_i16,
26850 xgyro: 0_i16,
26851 ygyro: 0_i16,
26852 zgyro: 0_i16,
26853 xmag: 0_i16,
26854 ymag: 0_i16,
26855 zmag: 0_i16,
26856 temperature: 0_i16,
26857 };
26858 #[cfg(feature = "arbitrary")]
26859 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26860 use arbitrary::{Arbitrary, Unstructured};
26861 let mut buf = [0u8; 1024];
26862 rng.fill_bytes(&mut buf);
26863 let mut unstructured = Unstructured::new(&buf);
26864 Self::arbitrary(&mut unstructured).unwrap_or_default()
26865 }
26866}
26867impl Default for SCALED_IMU2_DATA {
26868 fn default() -> Self {
26869 Self::DEFAULT.clone()
26870 }
26871}
26872impl MessageData for SCALED_IMU2_DATA {
26873 type Message = MavMessage;
26874 const ID: u32 = 116u32;
26875 const NAME: &'static str = "SCALED_IMU2";
26876 const EXTRA_CRC: u8 = 76u8;
26877 const ENCODED_LEN: usize = 24usize;
26878 fn deser(
26879 _version: MavlinkVersion,
26880 __input: &[u8],
26881 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26882 let avail_len = __input.len();
26883 let mut payload_buf = [0; Self::ENCODED_LEN];
26884 let mut buf = if avail_len < Self::ENCODED_LEN {
26885 payload_buf[0..avail_len].copy_from_slice(__input);
26886 Bytes::new(&payload_buf)
26887 } else {
26888 Bytes::new(__input)
26889 };
26890 let mut __struct = Self::default();
26891 __struct.time_boot_ms = buf.get_u32_le();
26892 __struct.xacc = buf.get_i16_le();
26893 __struct.yacc = buf.get_i16_le();
26894 __struct.zacc = buf.get_i16_le();
26895 __struct.xgyro = buf.get_i16_le();
26896 __struct.ygyro = buf.get_i16_le();
26897 __struct.zgyro = buf.get_i16_le();
26898 __struct.xmag = buf.get_i16_le();
26899 __struct.ymag = buf.get_i16_le();
26900 __struct.zmag = buf.get_i16_le();
26901 __struct.temperature = buf.get_i16_le();
26902 Ok(__struct)
26903 }
26904 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26905 let mut __tmp = BytesMut::new(bytes);
26906 #[allow(clippy::absurd_extreme_comparisons)]
26907 #[allow(unused_comparisons)]
26908 if __tmp.remaining() < Self::ENCODED_LEN {
26909 panic!(
26910 "buffer is too small (need {} bytes, but got {})",
26911 Self::ENCODED_LEN,
26912 __tmp.remaining(),
26913 )
26914 }
26915 __tmp.put_u32_le(self.time_boot_ms);
26916 __tmp.put_i16_le(self.xacc);
26917 __tmp.put_i16_le(self.yacc);
26918 __tmp.put_i16_le(self.zacc);
26919 __tmp.put_i16_le(self.xgyro);
26920 __tmp.put_i16_le(self.ygyro);
26921 __tmp.put_i16_le(self.zgyro);
26922 __tmp.put_i16_le(self.xmag);
26923 __tmp.put_i16_le(self.ymag);
26924 __tmp.put_i16_le(self.zmag);
26925 if matches!(version, MavlinkVersion::V2) {
26926 __tmp.put_i16_le(self.temperature);
26927 let len = __tmp.len();
26928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26929 } else {
26930 __tmp.len()
26931 }
26932 }
26933}
26934#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
26935#[doc = ""]
26936#[doc = "ID: 129"]
26937#[derive(Debug, Clone, PartialEq)]
26938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26940#[cfg_attr(feature = "ts", derive(TS))]
26941#[cfg_attr(feature = "ts", ts(export))]
26942pub struct SCALED_IMU3_DATA {
26943 #[doc = "Timestamp (time since system boot)."]
26944 pub time_boot_ms: u32,
26945 #[doc = "X acceleration"]
26946 pub xacc: i16,
26947 #[doc = "Y acceleration"]
26948 pub yacc: i16,
26949 #[doc = "Z acceleration"]
26950 pub zacc: i16,
26951 #[doc = "Angular speed around X axis"]
26952 pub xgyro: i16,
26953 #[doc = "Angular speed around Y axis"]
26954 pub ygyro: i16,
26955 #[doc = "Angular speed around Z axis"]
26956 pub zgyro: i16,
26957 #[doc = "X Magnetic field"]
26958 pub xmag: i16,
26959 #[doc = "Y Magnetic field"]
26960 pub ymag: i16,
26961 #[doc = "Z Magnetic field"]
26962 pub zmag: i16,
26963 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26964 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26965 pub temperature: i16,
26966}
26967impl SCALED_IMU3_DATA {
26968 pub const ENCODED_LEN: usize = 24usize;
26969 pub const DEFAULT: Self = Self {
26970 time_boot_ms: 0_u32,
26971 xacc: 0_i16,
26972 yacc: 0_i16,
26973 zacc: 0_i16,
26974 xgyro: 0_i16,
26975 ygyro: 0_i16,
26976 zgyro: 0_i16,
26977 xmag: 0_i16,
26978 ymag: 0_i16,
26979 zmag: 0_i16,
26980 temperature: 0_i16,
26981 };
26982 #[cfg(feature = "arbitrary")]
26983 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26984 use arbitrary::{Arbitrary, Unstructured};
26985 let mut buf = [0u8; 1024];
26986 rng.fill_bytes(&mut buf);
26987 let mut unstructured = Unstructured::new(&buf);
26988 Self::arbitrary(&mut unstructured).unwrap_or_default()
26989 }
26990}
26991impl Default for SCALED_IMU3_DATA {
26992 fn default() -> Self {
26993 Self::DEFAULT.clone()
26994 }
26995}
26996impl MessageData for SCALED_IMU3_DATA {
26997 type Message = MavMessage;
26998 const ID: u32 = 129u32;
26999 const NAME: &'static str = "SCALED_IMU3";
27000 const EXTRA_CRC: u8 = 46u8;
27001 const ENCODED_LEN: usize = 24usize;
27002 fn deser(
27003 _version: MavlinkVersion,
27004 __input: &[u8],
27005 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27006 let avail_len = __input.len();
27007 let mut payload_buf = [0; Self::ENCODED_LEN];
27008 let mut buf = if avail_len < Self::ENCODED_LEN {
27009 payload_buf[0..avail_len].copy_from_slice(__input);
27010 Bytes::new(&payload_buf)
27011 } else {
27012 Bytes::new(__input)
27013 };
27014 let mut __struct = Self::default();
27015 __struct.time_boot_ms = buf.get_u32_le();
27016 __struct.xacc = buf.get_i16_le();
27017 __struct.yacc = buf.get_i16_le();
27018 __struct.zacc = buf.get_i16_le();
27019 __struct.xgyro = buf.get_i16_le();
27020 __struct.ygyro = buf.get_i16_le();
27021 __struct.zgyro = buf.get_i16_le();
27022 __struct.xmag = buf.get_i16_le();
27023 __struct.ymag = buf.get_i16_le();
27024 __struct.zmag = buf.get_i16_le();
27025 __struct.temperature = buf.get_i16_le();
27026 Ok(__struct)
27027 }
27028 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27029 let mut __tmp = BytesMut::new(bytes);
27030 #[allow(clippy::absurd_extreme_comparisons)]
27031 #[allow(unused_comparisons)]
27032 if __tmp.remaining() < Self::ENCODED_LEN {
27033 panic!(
27034 "buffer is too small (need {} bytes, but got {})",
27035 Self::ENCODED_LEN,
27036 __tmp.remaining(),
27037 )
27038 }
27039 __tmp.put_u32_le(self.time_boot_ms);
27040 __tmp.put_i16_le(self.xacc);
27041 __tmp.put_i16_le(self.yacc);
27042 __tmp.put_i16_le(self.zacc);
27043 __tmp.put_i16_le(self.xgyro);
27044 __tmp.put_i16_le(self.ygyro);
27045 __tmp.put_i16_le(self.zgyro);
27046 __tmp.put_i16_le(self.xmag);
27047 __tmp.put_i16_le(self.ymag);
27048 __tmp.put_i16_le(self.zmag);
27049 if matches!(version, MavlinkVersion::V2) {
27050 __tmp.put_i16_le(self.temperature);
27051 let len = __tmp.len();
27052 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27053 } else {
27054 __tmp.len()
27055 }
27056 }
27057}
27058#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
27059#[doc = ""]
27060#[doc = "ID: 29"]
27061#[derive(Debug, Clone, PartialEq)]
27062#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27063#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27064#[cfg_attr(feature = "ts", derive(TS))]
27065#[cfg_attr(feature = "ts", ts(export))]
27066pub struct SCALED_PRESSURE_DATA {
27067 #[doc = "Timestamp (time since system boot)."]
27068 pub time_boot_ms: u32,
27069 #[doc = "Absolute pressure"]
27070 pub press_abs: f32,
27071 #[doc = "Differential pressure 1"]
27072 pub press_diff: f32,
27073 #[doc = "Absolute pressure temperature"]
27074 pub temperature: i16,
27075 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27076 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27077 pub temperature_press_diff: i16,
27078}
27079impl SCALED_PRESSURE_DATA {
27080 pub const ENCODED_LEN: usize = 16usize;
27081 pub const DEFAULT: Self = Self {
27082 time_boot_ms: 0_u32,
27083 press_abs: 0.0_f32,
27084 press_diff: 0.0_f32,
27085 temperature: 0_i16,
27086 temperature_press_diff: 0_i16,
27087 };
27088 #[cfg(feature = "arbitrary")]
27089 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27090 use arbitrary::{Arbitrary, Unstructured};
27091 let mut buf = [0u8; 1024];
27092 rng.fill_bytes(&mut buf);
27093 let mut unstructured = Unstructured::new(&buf);
27094 Self::arbitrary(&mut unstructured).unwrap_or_default()
27095 }
27096}
27097impl Default for SCALED_PRESSURE_DATA {
27098 fn default() -> Self {
27099 Self::DEFAULT.clone()
27100 }
27101}
27102impl MessageData for SCALED_PRESSURE_DATA {
27103 type Message = MavMessage;
27104 const ID: u32 = 29u32;
27105 const NAME: &'static str = "SCALED_PRESSURE";
27106 const EXTRA_CRC: u8 = 115u8;
27107 const ENCODED_LEN: usize = 16usize;
27108 fn deser(
27109 _version: MavlinkVersion,
27110 __input: &[u8],
27111 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27112 let avail_len = __input.len();
27113 let mut payload_buf = [0; Self::ENCODED_LEN];
27114 let mut buf = if avail_len < Self::ENCODED_LEN {
27115 payload_buf[0..avail_len].copy_from_slice(__input);
27116 Bytes::new(&payload_buf)
27117 } else {
27118 Bytes::new(__input)
27119 };
27120 let mut __struct = Self::default();
27121 __struct.time_boot_ms = buf.get_u32_le();
27122 __struct.press_abs = buf.get_f32_le();
27123 __struct.press_diff = buf.get_f32_le();
27124 __struct.temperature = buf.get_i16_le();
27125 __struct.temperature_press_diff = buf.get_i16_le();
27126 Ok(__struct)
27127 }
27128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27129 let mut __tmp = BytesMut::new(bytes);
27130 #[allow(clippy::absurd_extreme_comparisons)]
27131 #[allow(unused_comparisons)]
27132 if __tmp.remaining() < Self::ENCODED_LEN {
27133 panic!(
27134 "buffer is too small (need {} bytes, but got {})",
27135 Self::ENCODED_LEN,
27136 __tmp.remaining(),
27137 )
27138 }
27139 __tmp.put_u32_le(self.time_boot_ms);
27140 __tmp.put_f32_le(self.press_abs);
27141 __tmp.put_f32_le(self.press_diff);
27142 __tmp.put_i16_le(self.temperature);
27143 if matches!(version, MavlinkVersion::V2) {
27144 __tmp.put_i16_le(self.temperature_press_diff);
27145 let len = __tmp.len();
27146 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27147 } else {
27148 __tmp.len()
27149 }
27150 }
27151}
27152#[doc = "Barometer readings for 2nd barometer."]
27153#[doc = ""]
27154#[doc = "ID: 137"]
27155#[derive(Debug, Clone, PartialEq)]
27156#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27157#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27158#[cfg_attr(feature = "ts", derive(TS))]
27159#[cfg_attr(feature = "ts", ts(export))]
27160pub struct SCALED_PRESSURE2_DATA {
27161 #[doc = "Timestamp (time since system boot)."]
27162 pub time_boot_ms: u32,
27163 #[doc = "Absolute pressure"]
27164 pub press_abs: f32,
27165 #[doc = "Differential pressure"]
27166 pub press_diff: f32,
27167 #[doc = "Absolute pressure temperature"]
27168 pub temperature: i16,
27169 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27170 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27171 pub temperature_press_diff: i16,
27172}
27173impl SCALED_PRESSURE2_DATA {
27174 pub const ENCODED_LEN: usize = 16usize;
27175 pub const DEFAULT: Self = Self {
27176 time_boot_ms: 0_u32,
27177 press_abs: 0.0_f32,
27178 press_diff: 0.0_f32,
27179 temperature: 0_i16,
27180 temperature_press_diff: 0_i16,
27181 };
27182 #[cfg(feature = "arbitrary")]
27183 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27184 use arbitrary::{Arbitrary, Unstructured};
27185 let mut buf = [0u8; 1024];
27186 rng.fill_bytes(&mut buf);
27187 let mut unstructured = Unstructured::new(&buf);
27188 Self::arbitrary(&mut unstructured).unwrap_or_default()
27189 }
27190}
27191impl Default for SCALED_PRESSURE2_DATA {
27192 fn default() -> Self {
27193 Self::DEFAULT.clone()
27194 }
27195}
27196impl MessageData for SCALED_PRESSURE2_DATA {
27197 type Message = MavMessage;
27198 const ID: u32 = 137u32;
27199 const NAME: &'static str = "SCALED_PRESSURE2";
27200 const EXTRA_CRC: u8 = 195u8;
27201 const ENCODED_LEN: usize = 16usize;
27202 fn deser(
27203 _version: MavlinkVersion,
27204 __input: &[u8],
27205 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27206 let avail_len = __input.len();
27207 let mut payload_buf = [0; Self::ENCODED_LEN];
27208 let mut buf = if avail_len < Self::ENCODED_LEN {
27209 payload_buf[0..avail_len].copy_from_slice(__input);
27210 Bytes::new(&payload_buf)
27211 } else {
27212 Bytes::new(__input)
27213 };
27214 let mut __struct = Self::default();
27215 __struct.time_boot_ms = buf.get_u32_le();
27216 __struct.press_abs = buf.get_f32_le();
27217 __struct.press_diff = buf.get_f32_le();
27218 __struct.temperature = buf.get_i16_le();
27219 __struct.temperature_press_diff = buf.get_i16_le();
27220 Ok(__struct)
27221 }
27222 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27223 let mut __tmp = BytesMut::new(bytes);
27224 #[allow(clippy::absurd_extreme_comparisons)]
27225 #[allow(unused_comparisons)]
27226 if __tmp.remaining() < Self::ENCODED_LEN {
27227 panic!(
27228 "buffer is too small (need {} bytes, but got {})",
27229 Self::ENCODED_LEN,
27230 __tmp.remaining(),
27231 )
27232 }
27233 __tmp.put_u32_le(self.time_boot_ms);
27234 __tmp.put_f32_le(self.press_abs);
27235 __tmp.put_f32_le(self.press_diff);
27236 __tmp.put_i16_le(self.temperature);
27237 if matches!(version, MavlinkVersion::V2) {
27238 __tmp.put_i16_le(self.temperature_press_diff);
27239 let len = __tmp.len();
27240 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27241 } else {
27242 __tmp.len()
27243 }
27244 }
27245}
27246#[doc = "Barometer readings for 3rd barometer."]
27247#[doc = ""]
27248#[doc = "ID: 143"]
27249#[derive(Debug, Clone, PartialEq)]
27250#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27251#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27252#[cfg_attr(feature = "ts", derive(TS))]
27253#[cfg_attr(feature = "ts", ts(export))]
27254pub struct SCALED_PRESSURE3_DATA {
27255 #[doc = "Timestamp (time since system boot)."]
27256 pub time_boot_ms: u32,
27257 #[doc = "Absolute pressure"]
27258 pub press_abs: f32,
27259 #[doc = "Differential pressure"]
27260 pub press_diff: f32,
27261 #[doc = "Absolute pressure temperature"]
27262 pub temperature: i16,
27263 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27264 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27265 pub temperature_press_diff: i16,
27266}
27267impl SCALED_PRESSURE3_DATA {
27268 pub const ENCODED_LEN: usize = 16usize;
27269 pub const DEFAULT: Self = Self {
27270 time_boot_ms: 0_u32,
27271 press_abs: 0.0_f32,
27272 press_diff: 0.0_f32,
27273 temperature: 0_i16,
27274 temperature_press_diff: 0_i16,
27275 };
27276 #[cfg(feature = "arbitrary")]
27277 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27278 use arbitrary::{Arbitrary, Unstructured};
27279 let mut buf = [0u8; 1024];
27280 rng.fill_bytes(&mut buf);
27281 let mut unstructured = Unstructured::new(&buf);
27282 Self::arbitrary(&mut unstructured).unwrap_or_default()
27283 }
27284}
27285impl Default for SCALED_PRESSURE3_DATA {
27286 fn default() -> Self {
27287 Self::DEFAULT.clone()
27288 }
27289}
27290impl MessageData for SCALED_PRESSURE3_DATA {
27291 type Message = MavMessage;
27292 const ID: u32 = 143u32;
27293 const NAME: &'static str = "SCALED_PRESSURE3";
27294 const EXTRA_CRC: u8 = 131u8;
27295 const ENCODED_LEN: usize = 16usize;
27296 fn deser(
27297 _version: MavlinkVersion,
27298 __input: &[u8],
27299 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27300 let avail_len = __input.len();
27301 let mut payload_buf = [0; Self::ENCODED_LEN];
27302 let mut buf = if avail_len < Self::ENCODED_LEN {
27303 payload_buf[0..avail_len].copy_from_slice(__input);
27304 Bytes::new(&payload_buf)
27305 } else {
27306 Bytes::new(__input)
27307 };
27308 let mut __struct = Self::default();
27309 __struct.time_boot_ms = buf.get_u32_le();
27310 __struct.press_abs = buf.get_f32_le();
27311 __struct.press_diff = buf.get_f32_le();
27312 __struct.temperature = buf.get_i16_le();
27313 __struct.temperature_press_diff = buf.get_i16_le();
27314 Ok(__struct)
27315 }
27316 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27317 let mut __tmp = BytesMut::new(bytes);
27318 #[allow(clippy::absurd_extreme_comparisons)]
27319 #[allow(unused_comparisons)]
27320 if __tmp.remaining() < Self::ENCODED_LEN {
27321 panic!(
27322 "buffer is too small (need {} bytes, but got {})",
27323 Self::ENCODED_LEN,
27324 __tmp.remaining(),
27325 )
27326 }
27327 __tmp.put_u32_le(self.time_boot_ms);
27328 __tmp.put_f32_le(self.press_abs);
27329 __tmp.put_f32_le(self.press_diff);
27330 __tmp.put_i16_le(self.temperature);
27331 if matches!(version, MavlinkVersion::V2) {
27332 __tmp.put_i16_le(self.temperature_press_diff);
27333 let len = __tmp.len();
27334 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27335 } else {
27336 __tmp.len()
27337 }
27338 }
27339}
27340#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
27341#[doc = ""]
27342#[doc = "ID: 126"]
27343#[derive(Debug, Clone, PartialEq)]
27344#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27345#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27346#[cfg_attr(feature = "ts", derive(TS))]
27347#[cfg_attr(feature = "ts", ts(export))]
27348pub struct SERIAL_CONTROL_DATA {
27349 #[doc = "Baudrate of transfer. Zero means no change."]
27350 pub baudrate: u32,
27351 #[doc = "Timeout for reply data"]
27352 pub timeout: u16,
27353 #[doc = "Serial control device type."]
27354 pub device: SerialControlDev,
27355 #[doc = "Bitmap of serial control flags."]
27356 pub flags: SerialControlFlag,
27357 #[doc = "how many bytes in this transfer"]
27358 pub count: u8,
27359 #[doc = "serial data"]
27360 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27361 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27362 pub data: [u8; 70],
27363 #[doc = "System ID"]
27364 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27365 pub target_system: u8,
27366 #[doc = "Component ID"]
27367 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27368 pub target_component: u8,
27369}
27370impl SERIAL_CONTROL_DATA {
27371 pub const ENCODED_LEN: usize = 81usize;
27372 pub const DEFAULT: Self = Self {
27373 baudrate: 0_u32,
27374 timeout: 0_u16,
27375 device: SerialControlDev::DEFAULT,
27376 flags: SerialControlFlag::DEFAULT,
27377 count: 0_u8,
27378 data: [0_u8; 70usize],
27379 target_system: 0_u8,
27380 target_component: 0_u8,
27381 };
27382 #[cfg(feature = "arbitrary")]
27383 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27384 use arbitrary::{Arbitrary, Unstructured};
27385 let mut buf = [0u8; 1024];
27386 rng.fill_bytes(&mut buf);
27387 let mut unstructured = Unstructured::new(&buf);
27388 Self::arbitrary(&mut unstructured).unwrap_or_default()
27389 }
27390}
27391impl Default for SERIAL_CONTROL_DATA {
27392 fn default() -> Self {
27393 Self::DEFAULT.clone()
27394 }
27395}
27396impl MessageData for SERIAL_CONTROL_DATA {
27397 type Message = MavMessage;
27398 const ID: u32 = 126u32;
27399 const NAME: &'static str = "SERIAL_CONTROL";
27400 const EXTRA_CRC: u8 = 220u8;
27401 const ENCODED_LEN: usize = 81usize;
27402 fn deser(
27403 _version: MavlinkVersion,
27404 __input: &[u8],
27405 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27406 let avail_len = __input.len();
27407 let mut payload_buf = [0; Self::ENCODED_LEN];
27408 let mut buf = if avail_len < Self::ENCODED_LEN {
27409 payload_buf[0..avail_len].copy_from_slice(__input);
27410 Bytes::new(&payload_buf)
27411 } else {
27412 Bytes::new(__input)
27413 };
27414 let mut __struct = Self::default();
27415 __struct.baudrate = buf.get_u32_le();
27416 __struct.timeout = buf.get_u16_le();
27417 let tmp = buf.get_u8();
27418 __struct.device =
27419 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27420 enum_type: "SerialControlDev",
27421 value: tmp as u64,
27422 })?;
27423 let tmp = buf.get_u8();
27424 __struct.flags = SerialControlFlag::from_bits(tmp as <SerialControlFlag as Flags>::Bits)
27425 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27426 flag_type: "SerialControlFlag",
27427 value: tmp as u64,
27428 })?;
27429 __struct.count = buf.get_u8();
27430 for v in &mut __struct.data {
27431 let val = buf.get_u8();
27432 *v = val;
27433 }
27434 __struct.target_system = buf.get_u8();
27435 __struct.target_component = buf.get_u8();
27436 Ok(__struct)
27437 }
27438 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27439 let mut __tmp = BytesMut::new(bytes);
27440 #[allow(clippy::absurd_extreme_comparisons)]
27441 #[allow(unused_comparisons)]
27442 if __tmp.remaining() < Self::ENCODED_LEN {
27443 panic!(
27444 "buffer is too small (need {} bytes, but got {})",
27445 Self::ENCODED_LEN,
27446 __tmp.remaining(),
27447 )
27448 }
27449 __tmp.put_u32_le(self.baudrate);
27450 __tmp.put_u16_le(self.timeout);
27451 __tmp.put_u8(self.device as u8);
27452 __tmp.put_u8(self.flags.bits() as u8);
27453 __tmp.put_u8(self.count);
27454 for val in &self.data {
27455 __tmp.put_u8(*val);
27456 }
27457 if matches!(version, MavlinkVersion::V2) {
27458 __tmp.put_u8(self.target_system);
27459 __tmp.put_u8(self.target_component);
27460 let len = __tmp.len();
27461 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27462 } else {
27463 __tmp.len()
27464 }
27465 }
27466}
27467#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
27468#[doc = ""]
27469#[doc = "ID: 36"]
27470#[derive(Debug, Clone, PartialEq)]
27471#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27472#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27473#[cfg_attr(feature = "ts", derive(TS))]
27474#[cfg_attr(feature = "ts", ts(export))]
27475pub struct SERVO_OUTPUT_RAW_DATA {
27476 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27477 pub time_usec: u32,
27478 #[doc = "Servo output 1 value"]
27479 pub servo1_raw: u16,
27480 #[doc = "Servo output 2 value"]
27481 pub servo2_raw: u16,
27482 #[doc = "Servo output 3 value"]
27483 pub servo3_raw: u16,
27484 #[doc = "Servo output 4 value"]
27485 pub servo4_raw: u16,
27486 #[doc = "Servo output 5 value"]
27487 pub servo5_raw: u16,
27488 #[doc = "Servo output 6 value"]
27489 pub servo6_raw: u16,
27490 #[doc = "Servo output 7 value"]
27491 pub servo7_raw: u16,
27492 #[doc = "Servo output 8 value"]
27493 pub servo8_raw: u16,
27494 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
27495 pub port: u8,
27496 #[doc = "Servo output 9 value"]
27497 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27498 pub servo9_raw: u16,
27499 #[doc = "Servo output 10 value"]
27500 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27501 pub servo10_raw: u16,
27502 #[doc = "Servo output 11 value"]
27503 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27504 pub servo11_raw: u16,
27505 #[doc = "Servo output 12 value"]
27506 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27507 pub servo12_raw: u16,
27508 #[doc = "Servo output 13 value"]
27509 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27510 pub servo13_raw: u16,
27511 #[doc = "Servo output 14 value"]
27512 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27513 pub servo14_raw: u16,
27514 #[doc = "Servo output 15 value"]
27515 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27516 pub servo15_raw: u16,
27517 #[doc = "Servo output 16 value"]
27518 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27519 pub servo16_raw: u16,
27520}
27521impl SERVO_OUTPUT_RAW_DATA {
27522 pub const ENCODED_LEN: usize = 37usize;
27523 pub const DEFAULT: Self = Self {
27524 time_usec: 0_u32,
27525 servo1_raw: 0_u16,
27526 servo2_raw: 0_u16,
27527 servo3_raw: 0_u16,
27528 servo4_raw: 0_u16,
27529 servo5_raw: 0_u16,
27530 servo6_raw: 0_u16,
27531 servo7_raw: 0_u16,
27532 servo8_raw: 0_u16,
27533 port: 0_u8,
27534 servo9_raw: 0_u16,
27535 servo10_raw: 0_u16,
27536 servo11_raw: 0_u16,
27537 servo12_raw: 0_u16,
27538 servo13_raw: 0_u16,
27539 servo14_raw: 0_u16,
27540 servo15_raw: 0_u16,
27541 servo16_raw: 0_u16,
27542 };
27543 #[cfg(feature = "arbitrary")]
27544 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27545 use arbitrary::{Arbitrary, Unstructured};
27546 let mut buf = [0u8; 1024];
27547 rng.fill_bytes(&mut buf);
27548 let mut unstructured = Unstructured::new(&buf);
27549 Self::arbitrary(&mut unstructured).unwrap_or_default()
27550 }
27551}
27552impl Default for SERVO_OUTPUT_RAW_DATA {
27553 fn default() -> Self {
27554 Self::DEFAULT.clone()
27555 }
27556}
27557impl MessageData for SERVO_OUTPUT_RAW_DATA {
27558 type Message = MavMessage;
27559 const ID: u32 = 36u32;
27560 const NAME: &'static str = "SERVO_OUTPUT_RAW";
27561 const EXTRA_CRC: u8 = 222u8;
27562 const ENCODED_LEN: usize = 37usize;
27563 fn deser(
27564 _version: MavlinkVersion,
27565 __input: &[u8],
27566 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27567 let avail_len = __input.len();
27568 let mut payload_buf = [0; Self::ENCODED_LEN];
27569 let mut buf = if avail_len < Self::ENCODED_LEN {
27570 payload_buf[0..avail_len].copy_from_slice(__input);
27571 Bytes::new(&payload_buf)
27572 } else {
27573 Bytes::new(__input)
27574 };
27575 let mut __struct = Self::default();
27576 __struct.time_usec = buf.get_u32_le();
27577 __struct.servo1_raw = buf.get_u16_le();
27578 __struct.servo2_raw = buf.get_u16_le();
27579 __struct.servo3_raw = buf.get_u16_le();
27580 __struct.servo4_raw = buf.get_u16_le();
27581 __struct.servo5_raw = buf.get_u16_le();
27582 __struct.servo6_raw = buf.get_u16_le();
27583 __struct.servo7_raw = buf.get_u16_le();
27584 __struct.servo8_raw = buf.get_u16_le();
27585 __struct.port = buf.get_u8();
27586 __struct.servo9_raw = buf.get_u16_le();
27587 __struct.servo10_raw = buf.get_u16_le();
27588 __struct.servo11_raw = buf.get_u16_le();
27589 __struct.servo12_raw = buf.get_u16_le();
27590 __struct.servo13_raw = buf.get_u16_le();
27591 __struct.servo14_raw = buf.get_u16_le();
27592 __struct.servo15_raw = buf.get_u16_le();
27593 __struct.servo16_raw = buf.get_u16_le();
27594 Ok(__struct)
27595 }
27596 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27597 let mut __tmp = BytesMut::new(bytes);
27598 #[allow(clippy::absurd_extreme_comparisons)]
27599 #[allow(unused_comparisons)]
27600 if __tmp.remaining() < Self::ENCODED_LEN {
27601 panic!(
27602 "buffer is too small (need {} bytes, but got {})",
27603 Self::ENCODED_LEN,
27604 __tmp.remaining(),
27605 )
27606 }
27607 __tmp.put_u32_le(self.time_usec);
27608 __tmp.put_u16_le(self.servo1_raw);
27609 __tmp.put_u16_le(self.servo2_raw);
27610 __tmp.put_u16_le(self.servo3_raw);
27611 __tmp.put_u16_le(self.servo4_raw);
27612 __tmp.put_u16_le(self.servo5_raw);
27613 __tmp.put_u16_le(self.servo6_raw);
27614 __tmp.put_u16_le(self.servo7_raw);
27615 __tmp.put_u16_le(self.servo8_raw);
27616 __tmp.put_u8(self.port);
27617 if matches!(version, MavlinkVersion::V2) {
27618 __tmp.put_u16_le(self.servo9_raw);
27619 __tmp.put_u16_le(self.servo10_raw);
27620 __tmp.put_u16_le(self.servo11_raw);
27621 __tmp.put_u16_le(self.servo12_raw);
27622 __tmp.put_u16_le(self.servo13_raw);
27623 __tmp.put_u16_le(self.servo14_raw);
27624 __tmp.put_u16_le(self.servo15_raw);
27625 __tmp.put_u16_le(self.servo16_raw);
27626 let len = __tmp.len();
27627 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27628 } else {
27629 __tmp.len()
27630 }
27631 }
27632}
27633#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
27634#[doc = ""]
27635#[doc = "ID: 256"]
27636#[derive(Debug, Clone, PartialEq)]
27637#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27638#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27639#[cfg_attr(feature = "ts", derive(TS))]
27640#[cfg_attr(feature = "ts", ts(export))]
27641pub struct SETUP_SIGNING_DATA {
27642 #[doc = "initial timestamp"]
27643 pub initial_timestamp: u64,
27644 #[doc = "system id of the target"]
27645 pub target_system: u8,
27646 #[doc = "component ID of the target"]
27647 pub target_component: u8,
27648 #[doc = "signing key"]
27649 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27650 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27651 pub secret_key: [u8; 32],
27652}
27653impl SETUP_SIGNING_DATA {
27654 pub const ENCODED_LEN: usize = 42usize;
27655 pub const DEFAULT: Self = Self {
27656 initial_timestamp: 0_u64,
27657 target_system: 0_u8,
27658 target_component: 0_u8,
27659 secret_key: [0_u8; 32usize],
27660 };
27661 #[cfg(feature = "arbitrary")]
27662 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27663 use arbitrary::{Arbitrary, Unstructured};
27664 let mut buf = [0u8; 1024];
27665 rng.fill_bytes(&mut buf);
27666 let mut unstructured = Unstructured::new(&buf);
27667 Self::arbitrary(&mut unstructured).unwrap_or_default()
27668 }
27669}
27670impl Default for SETUP_SIGNING_DATA {
27671 fn default() -> Self {
27672 Self::DEFAULT.clone()
27673 }
27674}
27675impl MessageData for SETUP_SIGNING_DATA {
27676 type Message = MavMessage;
27677 const ID: u32 = 256u32;
27678 const NAME: &'static str = "SETUP_SIGNING";
27679 const EXTRA_CRC: u8 = 71u8;
27680 const ENCODED_LEN: usize = 42usize;
27681 fn deser(
27682 _version: MavlinkVersion,
27683 __input: &[u8],
27684 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27685 let avail_len = __input.len();
27686 let mut payload_buf = [0; Self::ENCODED_LEN];
27687 let mut buf = if avail_len < Self::ENCODED_LEN {
27688 payload_buf[0..avail_len].copy_from_slice(__input);
27689 Bytes::new(&payload_buf)
27690 } else {
27691 Bytes::new(__input)
27692 };
27693 let mut __struct = Self::default();
27694 __struct.initial_timestamp = buf.get_u64_le();
27695 __struct.target_system = buf.get_u8();
27696 __struct.target_component = buf.get_u8();
27697 for v in &mut __struct.secret_key {
27698 let val = buf.get_u8();
27699 *v = val;
27700 }
27701 Ok(__struct)
27702 }
27703 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27704 let mut __tmp = BytesMut::new(bytes);
27705 #[allow(clippy::absurd_extreme_comparisons)]
27706 #[allow(unused_comparisons)]
27707 if __tmp.remaining() < Self::ENCODED_LEN {
27708 panic!(
27709 "buffer is too small (need {} bytes, but got {})",
27710 Self::ENCODED_LEN,
27711 __tmp.remaining(),
27712 )
27713 }
27714 __tmp.put_u64_le(self.initial_timestamp);
27715 __tmp.put_u8(self.target_system);
27716 __tmp.put_u8(self.target_component);
27717 for val in &self.secret_key {
27718 __tmp.put_u8(*val);
27719 }
27720 if matches!(version, MavlinkVersion::V2) {
27721 let len = __tmp.len();
27722 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27723 } else {
27724 __tmp.len()
27725 }
27726 }
27727}
27728#[doc = "Set the vehicle attitude and body angular rates."]
27729#[doc = ""]
27730#[doc = "ID: 139"]
27731#[derive(Debug, Clone, PartialEq)]
27732#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27733#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27734#[cfg_attr(feature = "ts", derive(TS))]
27735#[cfg_attr(feature = "ts", ts(export))]
27736pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
27737 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27738 pub time_usec: u64,
27739 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
27740 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27741 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27742 pub controls: [f32; 8],
27743 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
27744 pub group_mlx: u8,
27745 #[doc = "System ID"]
27746 pub target_system: u8,
27747 #[doc = "Component ID"]
27748 pub target_component: u8,
27749}
27750impl SET_ACTUATOR_CONTROL_TARGET_DATA {
27751 pub const ENCODED_LEN: usize = 43usize;
27752 pub const DEFAULT: Self = Self {
27753 time_usec: 0_u64,
27754 controls: [0.0_f32; 8usize],
27755 group_mlx: 0_u8,
27756 target_system: 0_u8,
27757 target_component: 0_u8,
27758 };
27759 #[cfg(feature = "arbitrary")]
27760 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27761 use arbitrary::{Arbitrary, Unstructured};
27762 let mut buf = [0u8; 1024];
27763 rng.fill_bytes(&mut buf);
27764 let mut unstructured = Unstructured::new(&buf);
27765 Self::arbitrary(&mut unstructured).unwrap_or_default()
27766 }
27767}
27768impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
27769 fn default() -> Self {
27770 Self::DEFAULT.clone()
27771 }
27772}
27773impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
27774 type Message = MavMessage;
27775 const ID: u32 = 139u32;
27776 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
27777 const EXTRA_CRC: u8 = 168u8;
27778 const ENCODED_LEN: usize = 43usize;
27779 fn deser(
27780 _version: MavlinkVersion,
27781 __input: &[u8],
27782 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27783 let avail_len = __input.len();
27784 let mut payload_buf = [0; Self::ENCODED_LEN];
27785 let mut buf = if avail_len < Self::ENCODED_LEN {
27786 payload_buf[0..avail_len].copy_from_slice(__input);
27787 Bytes::new(&payload_buf)
27788 } else {
27789 Bytes::new(__input)
27790 };
27791 let mut __struct = Self::default();
27792 __struct.time_usec = buf.get_u64_le();
27793 for v in &mut __struct.controls {
27794 let val = buf.get_f32_le();
27795 *v = val;
27796 }
27797 __struct.group_mlx = buf.get_u8();
27798 __struct.target_system = buf.get_u8();
27799 __struct.target_component = buf.get_u8();
27800 Ok(__struct)
27801 }
27802 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27803 let mut __tmp = BytesMut::new(bytes);
27804 #[allow(clippy::absurd_extreme_comparisons)]
27805 #[allow(unused_comparisons)]
27806 if __tmp.remaining() < Self::ENCODED_LEN {
27807 panic!(
27808 "buffer is too small (need {} bytes, but got {})",
27809 Self::ENCODED_LEN,
27810 __tmp.remaining(),
27811 )
27812 }
27813 __tmp.put_u64_le(self.time_usec);
27814 for val in &self.controls {
27815 __tmp.put_f32_le(*val);
27816 }
27817 __tmp.put_u8(self.group_mlx);
27818 __tmp.put_u8(self.target_system);
27819 __tmp.put_u8(self.target_component);
27820 if matches!(version, MavlinkVersion::V2) {
27821 let len = __tmp.len();
27822 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27823 } else {
27824 __tmp.len()
27825 }
27826 }
27827}
27828#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
27829#[doc = ""]
27830#[doc = "ID: 82"]
27831#[derive(Debug, Clone, PartialEq)]
27832#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27833#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27834#[cfg_attr(feature = "ts", derive(TS))]
27835#[cfg_attr(feature = "ts", ts(export))]
27836pub struct SET_ATTITUDE_TARGET_DATA {
27837 #[doc = "Timestamp (time since system boot)."]
27838 pub time_boot_ms: u32,
27839 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
27840 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27841 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27842 pub q: [f32; 4],
27843 #[doc = "Body roll rate"]
27844 pub body_roll_rate: f32,
27845 #[doc = "Body pitch rate"]
27846 pub body_pitch_rate: f32,
27847 #[doc = "Body yaw rate"]
27848 pub body_yaw_rate: f32,
27849 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
27850 pub thrust: f32,
27851 #[doc = "System ID"]
27852 pub target_system: u8,
27853 #[doc = "Component ID"]
27854 pub target_component: u8,
27855 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27856 pub type_mask: AttitudeTargetTypemask,
27857 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
27858 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27859 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27860 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27861 pub thrust_body: [f32; 3],
27862}
27863impl SET_ATTITUDE_TARGET_DATA {
27864 pub const ENCODED_LEN: usize = 51usize;
27865 pub const DEFAULT: Self = Self {
27866 time_boot_ms: 0_u32,
27867 q: [0.0_f32; 4usize],
27868 body_roll_rate: 0.0_f32,
27869 body_pitch_rate: 0.0_f32,
27870 body_yaw_rate: 0.0_f32,
27871 thrust: 0.0_f32,
27872 target_system: 0_u8,
27873 target_component: 0_u8,
27874 type_mask: AttitudeTargetTypemask::DEFAULT,
27875 thrust_body: [0.0_f32; 3usize],
27876 };
27877 #[cfg(feature = "arbitrary")]
27878 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27879 use arbitrary::{Arbitrary, Unstructured};
27880 let mut buf = [0u8; 1024];
27881 rng.fill_bytes(&mut buf);
27882 let mut unstructured = Unstructured::new(&buf);
27883 Self::arbitrary(&mut unstructured).unwrap_or_default()
27884 }
27885}
27886impl Default for SET_ATTITUDE_TARGET_DATA {
27887 fn default() -> Self {
27888 Self::DEFAULT.clone()
27889 }
27890}
27891impl MessageData for SET_ATTITUDE_TARGET_DATA {
27892 type Message = MavMessage;
27893 const ID: u32 = 82u32;
27894 const NAME: &'static str = "SET_ATTITUDE_TARGET";
27895 const EXTRA_CRC: u8 = 49u8;
27896 const ENCODED_LEN: usize = 51usize;
27897 fn deser(
27898 _version: MavlinkVersion,
27899 __input: &[u8],
27900 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27901 let avail_len = __input.len();
27902 let mut payload_buf = [0; Self::ENCODED_LEN];
27903 let mut buf = if avail_len < Self::ENCODED_LEN {
27904 payload_buf[0..avail_len].copy_from_slice(__input);
27905 Bytes::new(&payload_buf)
27906 } else {
27907 Bytes::new(__input)
27908 };
27909 let mut __struct = Self::default();
27910 __struct.time_boot_ms = buf.get_u32_le();
27911 for v in &mut __struct.q {
27912 let val = buf.get_f32_le();
27913 *v = val;
27914 }
27915 __struct.body_roll_rate = buf.get_f32_le();
27916 __struct.body_pitch_rate = buf.get_f32_le();
27917 __struct.body_yaw_rate = buf.get_f32_le();
27918 __struct.thrust = buf.get_f32_le();
27919 __struct.target_system = buf.get_u8();
27920 __struct.target_component = buf.get_u8();
27921 let tmp = buf.get_u8();
27922 __struct.type_mask =
27923 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
27924 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27925 flag_type: "AttitudeTargetTypemask",
27926 value: tmp as u64,
27927 })?;
27928 for v in &mut __struct.thrust_body {
27929 let val = buf.get_f32_le();
27930 *v = val;
27931 }
27932 Ok(__struct)
27933 }
27934 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27935 let mut __tmp = BytesMut::new(bytes);
27936 #[allow(clippy::absurd_extreme_comparisons)]
27937 #[allow(unused_comparisons)]
27938 if __tmp.remaining() < Self::ENCODED_LEN {
27939 panic!(
27940 "buffer is too small (need {} bytes, but got {})",
27941 Self::ENCODED_LEN,
27942 __tmp.remaining(),
27943 )
27944 }
27945 __tmp.put_u32_le(self.time_boot_ms);
27946 for val in &self.q {
27947 __tmp.put_f32_le(*val);
27948 }
27949 __tmp.put_f32_le(self.body_roll_rate);
27950 __tmp.put_f32_le(self.body_pitch_rate);
27951 __tmp.put_f32_le(self.body_yaw_rate);
27952 __tmp.put_f32_le(self.thrust);
27953 __tmp.put_u8(self.target_system);
27954 __tmp.put_u8(self.target_component);
27955 __tmp.put_u8(self.type_mask.bits() as u8);
27956 if matches!(version, MavlinkVersion::V2) {
27957 for val in &self.thrust_body {
27958 __tmp.put_f32_le(*val);
27959 }
27960 let len = __tmp.len();
27961 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27962 } else {
27963 __tmp.len()
27964 }
27965 }
27966}
27967#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
27968#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
27969#[doc = ""]
27970#[doc = "ID: 48"]
27971#[derive(Debug, Clone, PartialEq)]
27972#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27973#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27974#[cfg_attr(feature = "ts", derive(TS))]
27975#[cfg_attr(feature = "ts", ts(export))]
27976pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
27977 #[doc = "Latitude (WGS84)"]
27978 pub latitude: i32,
27979 #[doc = "Longitude (WGS84)"]
27980 pub longitude: i32,
27981 #[doc = "Altitude (MSL). Positive for up."]
27982 pub altitude: i32,
27983 #[doc = "System ID"]
27984 pub target_system: u8,
27985 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27986 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27987 pub time_usec: u64,
27988}
27989impl SET_GPS_GLOBAL_ORIGIN_DATA {
27990 pub const ENCODED_LEN: usize = 21usize;
27991 pub const DEFAULT: Self = Self {
27992 latitude: 0_i32,
27993 longitude: 0_i32,
27994 altitude: 0_i32,
27995 target_system: 0_u8,
27996 time_usec: 0_u64,
27997 };
27998 #[cfg(feature = "arbitrary")]
27999 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28000 use arbitrary::{Arbitrary, Unstructured};
28001 let mut buf = [0u8; 1024];
28002 rng.fill_bytes(&mut buf);
28003 let mut unstructured = Unstructured::new(&buf);
28004 Self::arbitrary(&mut unstructured).unwrap_or_default()
28005 }
28006}
28007impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
28008 fn default() -> Self {
28009 Self::DEFAULT.clone()
28010 }
28011}
28012impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
28013 type Message = MavMessage;
28014 const ID: u32 = 48u32;
28015 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
28016 const EXTRA_CRC: u8 = 41u8;
28017 const ENCODED_LEN: usize = 21usize;
28018 fn deser(
28019 _version: MavlinkVersion,
28020 __input: &[u8],
28021 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28022 let avail_len = __input.len();
28023 let mut payload_buf = [0; Self::ENCODED_LEN];
28024 let mut buf = if avail_len < Self::ENCODED_LEN {
28025 payload_buf[0..avail_len].copy_from_slice(__input);
28026 Bytes::new(&payload_buf)
28027 } else {
28028 Bytes::new(__input)
28029 };
28030 let mut __struct = Self::default();
28031 __struct.latitude = buf.get_i32_le();
28032 __struct.longitude = buf.get_i32_le();
28033 __struct.altitude = buf.get_i32_le();
28034 __struct.target_system = buf.get_u8();
28035 __struct.time_usec = buf.get_u64_le();
28036 Ok(__struct)
28037 }
28038 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28039 let mut __tmp = BytesMut::new(bytes);
28040 #[allow(clippy::absurd_extreme_comparisons)]
28041 #[allow(unused_comparisons)]
28042 if __tmp.remaining() < Self::ENCODED_LEN {
28043 panic!(
28044 "buffer is too small (need {} bytes, but got {})",
28045 Self::ENCODED_LEN,
28046 __tmp.remaining(),
28047 )
28048 }
28049 __tmp.put_i32_le(self.latitude);
28050 __tmp.put_i32_le(self.longitude);
28051 __tmp.put_i32_le(self.altitude);
28052 __tmp.put_u8(self.target_system);
28053 if matches!(version, MavlinkVersion::V2) {
28054 __tmp.put_u64_le(self.time_usec);
28055 let len = __tmp.len();
28056 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28057 } else {
28058 __tmp.len()
28059 }
28060 }
28061}
28062#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
28063#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
28064#[doc = ""]
28065#[doc = "ID: 243"]
28066#[derive(Debug, Clone, PartialEq)]
28067#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28068#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28069#[cfg_attr(feature = "ts", derive(TS))]
28070#[cfg_attr(feature = "ts", ts(export))]
28071pub struct SET_HOME_POSITION_DATA {
28072 #[doc = "Latitude (WGS84)"]
28073 pub latitude: i32,
28074 #[doc = "Longitude (WGS84)"]
28075 pub longitude: i32,
28076 #[doc = "Altitude (MSL). Positive for up."]
28077 pub altitude: i32,
28078 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
28079 pub x: f32,
28080 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
28081 pub y: f32,
28082 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
28083 pub z: f32,
28084 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
28085 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28086 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28087 pub q: [f32; 4],
28088 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28089 pub approach_x: f32,
28090 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28091 pub approach_y: f32,
28092 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28093 pub approach_z: f32,
28094 #[doc = "System ID."]
28095 pub target_system: u8,
28096 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28097 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28098 pub time_usec: u64,
28099}
28100impl SET_HOME_POSITION_DATA {
28101 pub const ENCODED_LEN: usize = 61usize;
28102 pub const DEFAULT: Self = Self {
28103 latitude: 0_i32,
28104 longitude: 0_i32,
28105 altitude: 0_i32,
28106 x: 0.0_f32,
28107 y: 0.0_f32,
28108 z: 0.0_f32,
28109 q: [0.0_f32; 4usize],
28110 approach_x: 0.0_f32,
28111 approach_y: 0.0_f32,
28112 approach_z: 0.0_f32,
28113 target_system: 0_u8,
28114 time_usec: 0_u64,
28115 };
28116 #[cfg(feature = "arbitrary")]
28117 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28118 use arbitrary::{Arbitrary, Unstructured};
28119 let mut buf = [0u8; 1024];
28120 rng.fill_bytes(&mut buf);
28121 let mut unstructured = Unstructured::new(&buf);
28122 Self::arbitrary(&mut unstructured).unwrap_or_default()
28123 }
28124}
28125impl Default for SET_HOME_POSITION_DATA {
28126 fn default() -> Self {
28127 Self::DEFAULT.clone()
28128 }
28129}
28130impl MessageData for SET_HOME_POSITION_DATA {
28131 type Message = MavMessage;
28132 const ID: u32 = 243u32;
28133 const NAME: &'static str = "SET_HOME_POSITION";
28134 const EXTRA_CRC: u8 = 85u8;
28135 const ENCODED_LEN: usize = 61usize;
28136 fn deser(
28137 _version: MavlinkVersion,
28138 __input: &[u8],
28139 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28140 let avail_len = __input.len();
28141 let mut payload_buf = [0; Self::ENCODED_LEN];
28142 let mut buf = if avail_len < Self::ENCODED_LEN {
28143 payload_buf[0..avail_len].copy_from_slice(__input);
28144 Bytes::new(&payload_buf)
28145 } else {
28146 Bytes::new(__input)
28147 };
28148 let mut __struct = Self::default();
28149 __struct.latitude = buf.get_i32_le();
28150 __struct.longitude = buf.get_i32_le();
28151 __struct.altitude = buf.get_i32_le();
28152 __struct.x = buf.get_f32_le();
28153 __struct.y = buf.get_f32_le();
28154 __struct.z = buf.get_f32_le();
28155 for v in &mut __struct.q {
28156 let val = buf.get_f32_le();
28157 *v = val;
28158 }
28159 __struct.approach_x = buf.get_f32_le();
28160 __struct.approach_y = buf.get_f32_le();
28161 __struct.approach_z = buf.get_f32_le();
28162 __struct.target_system = buf.get_u8();
28163 __struct.time_usec = buf.get_u64_le();
28164 Ok(__struct)
28165 }
28166 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28167 let mut __tmp = BytesMut::new(bytes);
28168 #[allow(clippy::absurd_extreme_comparisons)]
28169 #[allow(unused_comparisons)]
28170 if __tmp.remaining() < Self::ENCODED_LEN {
28171 panic!(
28172 "buffer is too small (need {} bytes, but got {})",
28173 Self::ENCODED_LEN,
28174 __tmp.remaining(),
28175 )
28176 }
28177 __tmp.put_i32_le(self.latitude);
28178 __tmp.put_i32_le(self.longitude);
28179 __tmp.put_i32_le(self.altitude);
28180 __tmp.put_f32_le(self.x);
28181 __tmp.put_f32_le(self.y);
28182 __tmp.put_f32_le(self.z);
28183 for val in &self.q {
28184 __tmp.put_f32_le(*val);
28185 }
28186 __tmp.put_f32_le(self.approach_x);
28187 __tmp.put_f32_le(self.approach_y);
28188 __tmp.put_f32_le(self.approach_z);
28189 __tmp.put_u8(self.target_system);
28190 if matches!(version, MavlinkVersion::V2) {
28191 __tmp.put_u64_le(self.time_usec);
28192 let len = __tmp.len();
28193 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28194 } else {
28195 __tmp.len()
28196 }
28197 }
28198}
28199#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
28200#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
28201#[doc = ""]
28202#[doc = "ID: 11"]
28203#[derive(Debug, Clone, PartialEq)]
28204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28206#[cfg_attr(feature = "ts", derive(TS))]
28207#[cfg_attr(feature = "ts", ts(export))]
28208pub struct SET_MODE_DATA {
28209 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
28210 pub custom_mode: u32,
28211 #[doc = "The system setting the mode"]
28212 pub target_system: u8,
28213 #[doc = "The new base mode."]
28214 pub base_mode: MavMode,
28215}
28216impl SET_MODE_DATA {
28217 pub const ENCODED_LEN: usize = 6usize;
28218 pub const DEFAULT: Self = Self {
28219 custom_mode: 0_u32,
28220 target_system: 0_u8,
28221 base_mode: MavMode::DEFAULT,
28222 };
28223 #[cfg(feature = "arbitrary")]
28224 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28225 use arbitrary::{Arbitrary, Unstructured};
28226 let mut buf = [0u8; 1024];
28227 rng.fill_bytes(&mut buf);
28228 let mut unstructured = Unstructured::new(&buf);
28229 Self::arbitrary(&mut unstructured).unwrap_or_default()
28230 }
28231}
28232impl Default for SET_MODE_DATA {
28233 fn default() -> Self {
28234 Self::DEFAULT.clone()
28235 }
28236}
28237impl MessageData for SET_MODE_DATA {
28238 type Message = MavMessage;
28239 const ID: u32 = 11u32;
28240 const NAME: &'static str = "SET_MODE";
28241 const EXTRA_CRC: u8 = 89u8;
28242 const ENCODED_LEN: usize = 6usize;
28243 fn deser(
28244 _version: MavlinkVersion,
28245 __input: &[u8],
28246 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28247 let avail_len = __input.len();
28248 let mut payload_buf = [0; Self::ENCODED_LEN];
28249 let mut buf = if avail_len < Self::ENCODED_LEN {
28250 payload_buf[0..avail_len].copy_from_slice(__input);
28251 Bytes::new(&payload_buf)
28252 } else {
28253 Bytes::new(__input)
28254 };
28255 let mut __struct = Self::default();
28256 __struct.custom_mode = buf.get_u32_le();
28257 __struct.target_system = buf.get_u8();
28258 let tmp = buf.get_u8();
28259 __struct.base_mode =
28260 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28261 enum_type: "MavMode",
28262 value: tmp as u64,
28263 })?;
28264 Ok(__struct)
28265 }
28266 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28267 let mut __tmp = BytesMut::new(bytes);
28268 #[allow(clippy::absurd_extreme_comparisons)]
28269 #[allow(unused_comparisons)]
28270 if __tmp.remaining() < Self::ENCODED_LEN {
28271 panic!(
28272 "buffer is too small (need {} bytes, but got {})",
28273 Self::ENCODED_LEN,
28274 __tmp.remaining(),
28275 )
28276 }
28277 __tmp.put_u32_le(self.custom_mode);
28278 __tmp.put_u8(self.target_system);
28279 __tmp.put_u8(self.base_mode as u8);
28280 if matches!(version, MavlinkVersion::V2) {
28281 let len = __tmp.len();
28282 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28283 } else {
28284 __tmp.len()
28285 }
28286 }
28287}
28288#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
28289#[doc = ""]
28290#[doc = "ID: 86"]
28291#[derive(Debug, Clone, PartialEq)]
28292#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28293#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28294#[cfg_attr(feature = "ts", derive(TS))]
28295#[cfg_attr(feature = "ts", ts(export))]
28296pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
28297 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
28298 pub time_boot_ms: u32,
28299 #[doc = "Latitude in WGS84 frame"]
28300 pub lat_int: i32,
28301 #[doc = "Longitude in WGS84 frame"]
28302 pub lon_int: i32,
28303 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
28304 pub alt: f32,
28305 #[doc = "X velocity in NED frame"]
28306 pub vx: f32,
28307 #[doc = "Y velocity in NED frame"]
28308 pub vy: f32,
28309 #[doc = "Z velocity in NED frame"]
28310 pub vz: f32,
28311 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28312 pub afx: f32,
28313 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28314 pub afy: f32,
28315 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28316 pub afz: f32,
28317 #[doc = "yaw setpoint"]
28318 pub yaw: f32,
28319 #[doc = "yaw rate setpoint"]
28320 pub yaw_rate: f32,
28321 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28322 pub type_mask: PositionTargetTypemask,
28323 #[doc = "System ID"]
28324 pub target_system: u8,
28325 #[doc = "Component ID"]
28326 pub target_component: u8,
28327 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
28328 pub coordinate_frame: MavFrame,
28329}
28330impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
28331 pub const ENCODED_LEN: usize = 53usize;
28332 pub const DEFAULT: Self = Self {
28333 time_boot_ms: 0_u32,
28334 lat_int: 0_i32,
28335 lon_int: 0_i32,
28336 alt: 0.0_f32,
28337 vx: 0.0_f32,
28338 vy: 0.0_f32,
28339 vz: 0.0_f32,
28340 afx: 0.0_f32,
28341 afy: 0.0_f32,
28342 afz: 0.0_f32,
28343 yaw: 0.0_f32,
28344 yaw_rate: 0.0_f32,
28345 type_mask: PositionTargetTypemask::DEFAULT,
28346 target_system: 0_u8,
28347 target_component: 0_u8,
28348 coordinate_frame: MavFrame::DEFAULT,
28349 };
28350 #[cfg(feature = "arbitrary")]
28351 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28352 use arbitrary::{Arbitrary, Unstructured};
28353 let mut buf = [0u8; 1024];
28354 rng.fill_bytes(&mut buf);
28355 let mut unstructured = Unstructured::new(&buf);
28356 Self::arbitrary(&mut unstructured).unwrap_or_default()
28357 }
28358}
28359impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28360 fn default() -> Self {
28361 Self::DEFAULT.clone()
28362 }
28363}
28364impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28365 type Message = MavMessage;
28366 const ID: u32 = 86u32;
28367 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
28368 const EXTRA_CRC: u8 = 5u8;
28369 const ENCODED_LEN: usize = 53usize;
28370 fn deser(
28371 _version: MavlinkVersion,
28372 __input: &[u8],
28373 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28374 let avail_len = __input.len();
28375 let mut payload_buf = [0; Self::ENCODED_LEN];
28376 let mut buf = if avail_len < Self::ENCODED_LEN {
28377 payload_buf[0..avail_len].copy_from_slice(__input);
28378 Bytes::new(&payload_buf)
28379 } else {
28380 Bytes::new(__input)
28381 };
28382 let mut __struct = Self::default();
28383 __struct.time_boot_ms = buf.get_u32_le();
28384 __struct.lat_int = buf.get_i32_le();
28385 __struct.lon_int = buf.get_i32_le();
28386 __struct.alt = buf.get_f32_le();
28387 __struct.vx = buf.get_f32_le();
28388 __struct.vy = buf.get_f32_le();
28389 __struct.vz = buf.get_f32_le();
28390 __struct.afx = buf.get_f32_le();
28391 __struct.afy = buf.get_f32_le();
28392 __struct.afz = buf.get_f32_le();
28393 __struct.yaw = buf.get_f32_le();
28394 __struct.yaw_rate = buf.get_f32_le();
28395 let tmp = buf.get_u16_le();
28396 __struct.type_mask =
28397 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
28398 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28399 flag_type: "PositionTargetTypemask",
28400 value: tmp as u64,
28401 })?;
28402 __struct.target_system = buf.get_u8();
28403 __struct.target_component = buf.get_u8();
28404 let tmp = buf.get_u8();
28405 __struct.coordinate_frame =
28406 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28407 enum_type: "MavFrame",
28408 value: tmp as u64,
28409 })?;
28410 Ok(__struct)
28411 }
28412 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28413 let mut __tmp = BytesMut::new(bytes);
28414 #[allow(clippy::absurd_extreme_comparisons)]
28415 #[allow(unused_comparisons)]
28416 if __tmp.remaining() < Self::ENCODED_LEN {
28417 panic!(
28418 "buffer is too small (need {} bytes, but got {})",
28419 Self::ENCODED_LEN,
28420 __tmp.remaining(),
28421 )
28422 }
28423 __tmp.put_u32_le(self.time_boot_ms);
28424 __tmp.put_i32_le(self.lat_int);
28425 __tmp.put_i32_le(self.lon_int);
28426 __tmp.put_f32_le(self.alt);
28427 __tmp.put_f32_le(self.vx);
28428 __tmp.put_f32_le(self.vy);
28429 __tmp.put_f32_le(self.vz);
28430 __tmp.put_f32_le(self.afx);
28431 __tmp.put_f32_le(self.afy);
28432 __tmp.put_f32_le(self.afz);
28433 __tmp.put_f32_le(self.yaw);
28434 __tmp.put_f32_le(self.yaw_rate);
28435 __tmp.put_u16_le(self.type_mask.bits() as u16);
28436 __tmp.put_u8(self.target_system);
28437 __tmp.put_u8(self.target_component);
28438 __tmp.put_u8(self.coordinate_frame as u8);
28439 if matches!(version, MavlinkVersion::V2) {
28440 let len = __tmp.len();
28441 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28442 } else {
28443 __tmp.len()
28444 }
28445 }
28446}
28447#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
28448#[doc = ""]
28449#[doc = "ID: 84"]
28450#[derive(Debug, Clone, PartialEq)]
28451#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28452#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28453#[cfg_attr(feature = "ts", derive(TS))]
28454#[cfg_attr(feature = "ts", ts(export))]
28455pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
28456 #[doc = "Timestamp (time since system boot)."]
28457 pub time_boot_ms: u32,
28458 #[doc = "X Position in NED frame"]
28459 pub x: f32,
28460 #[doc = "Y Position in NED frame"]
28461 pub y: f32,
28462 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
28463 pub z: f32,
28464 #[doc = "X velocity in NED frame"]
28465 pub vx: f32,
28466 #[doc = "Y velocity in NED frame"]
28467 pub vy: f32,
28468 #[doc = "Z velocity in NED frame"]
28469 pub vz: f32,
28470 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28471 pub afx: f32,
28472 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28473 pub afy: f32,
28474 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28475 pub afz: f32,
28476 #[doc = "yaw setpoint"]
28477 pub yaw: f32,
28478 #[doc = "yaw rate setpoint"]
28479 pub yaw_rate: f32,
28480 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28481 pub type_mask: PositionTargetTypemask,
28482 #[doc = "System ID"]
28483 pub target_system: u8,
28484 #[doc = "Component ID"]
28485 pub target_component: u8,
28486 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
28487 pub coordinate_frame: MavFrame,
28488}
28489impl SET_POSITION_TARGET_LOCAL_NED_DATA {
28490 pub const ENCODED_LEN: usize = 53usize;
28491 pub const DEFAULT: Self = Self {
28492 time_boot_ms: 0_u32,
28493 x: 0.0_f32,
28494 y: 0.0_f32,
28495 z: 0.0_f32,
28496 vx: 0.0_f32,
28497 vy: 0.0_f32,
28498 vz: 0.0_f32,
28499 afx: 0.0_f32,
28500 afy: 0.0_f32,
28501 afz: 0.0_f32,
28502 yaw: 0.0_f32,
28503 yaw_rate: 0.0_f32,
28504 type_mask: PositionTargetTypemask::DEFAULT,
28505 target_system: 0_u8,
28506 target_component: 0_u8,
28507 coordinate_frame: MavFrame::DEFAULT,
28508 };
28509 #[cfg(feature = "arbitrary")]
28510 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28511 use arbitrary::{Arbitrary, Unstructured};
28512 let mut buf = [0u8; 1024];
28513 rng.fill_bytes(&mut buf);
28514 let mut unstructured = Unstructured::new(&buf);
28515 Self::arbitrary(&mut unstructured).unwrap_or_default()
28516 }
28517}
28518impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
28519 fn default() -> Self {
28520 Self::DEFAULT.clone()
28521 }
28522}
28523impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
28524 type Message = MavMessage;
28525 const ID: u32 = 84u32;
28526 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
28527 const EXTRA_CRC: u8 = 143u8;
28528 const ENCODED_LEN: usize = 53usize;
28529 fn deser(
28530 _version: MavlinkVersion,
28531 __input: &[u8],
28532 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28533 let avail_len = __input.len();
28534 let mut payload_buf = [0; Self::ENCODED_LEN];
28535 let mut buf = if avail_len < Self::ENCODED_LEN {
28536 payload_buf[0..avail_len].copy_from_slice(__input);
28537 Bytes::new(&payload_buf)
28538 } else {
28539 Bytes::new(__input)
28540 };
28541 let mut __struct = Self::default();
28542 __struct.time_boot_ms = buf.get_u32_le();
28543 __struct.x = buf.get_f32_le();
28544 __struct.y = buf.get_f32_le();
28545 __struct.z = buf.get_f32_le();
28546 __struct.vx = buf.get_f32_le();
28547 __struct.vy = buf.get_f32_le();
28548 __struct.vz = buf.get_f32_le();
28549 __struct.afx = buf.get_f32_le();
28550 __struct.afy = buf.get_f32_le();
28551 __struct.afz = buf.get_f32_le();
28552 __struct.yaw = buf.get_f32_le();
28553 __struct.yaw_rate = buf.get_f32_le();
28554 let tmp = buf.get_u16_le();
28555 __struct.type_mask =
28556 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
28557 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28558 flag_type: "PositionTargetTypemask",
28559 value: tmp as u64,
28560 })?;
28561 __struct.target_system = buf.get_u8();
28562 __struct.target_component = buf.get_u8();
28563 let tmp = buf.get_u8();
28564 __struct.coordinate_frame =
28565 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28566 enum_type: "MavFrame",
28567 value: tmp as u64,
28568 })?;
28569 Ok(__struct)
28570 }
28571 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28572 let mut __tmp = BytesMut::new(bytes);
28573 #[allow(clippy::absurd_extreme_comparisons)]
28574 #[allow(unused_comparisons)]
28575 if __tmp.remaining() < Self::ENCODED_LEN {
28576 panic!(
28577 "buffer is too small (need {} bytes, but got {})",
28578 Self::ENCODED_LEN,
28579 __tmp.remaining(),
28580 )
28581 }
28582 __tmp.put_u32_le(self.time_boot_ms);
28583 __tmp.put_f32_le(self.x);
28584 __tmp.put_f32_le(self.y);
28585 __tmp.put_f32_le(self.z);
28586 __tmp.put_f32_le(self.vx);
28587 __tmp.put_f32_le(self.vy);
28588 __tmp.put_f32_le(self.vz);
28589 __tmp.put_f32_le(self.afx);
28590 __tmp.put_f32_le(self.afy);
28591 __tmp.put_f32_le(self.afz);
28592 __tmp.put_f32_le(self.yaw);
28593 __tmp.put_f32_le(self.yaw_rate);
28594 __tmp.put_u16_le(self.type_mask.bits() as u16);
28595 __tmp.put_u8(self.target_system);
28596 __tmp.put_u8(self.target_component);
28597 __tmp.put_u8(self.coordinate_frame as u8);
28598 if matches!(version, MavlinkVersion::V2) {
28599 let len = __tmp.len();
28600 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28601 } else {
28602 __tmp.len()
28603 }
28604 }
28605}
28606#[doc = "Status of simulation environment, if used."]
28607#[doc = ""]
28608#[doc = "ID: 108"]
28609#[derive(Debug, Clone, PartialEq)]
28610#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28611#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28612#[cfg_attr(feature = "ts", derive(TS))]
28613#[cfg_attr(feature = "ts", ts(export))]
28614pub struct SIM_STATE_DATA {
28615 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
28616 pub q1: f32,
28617 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
28618 pub q2: f32,
28619 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
28620 pub q3: f32,
28621 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
28622 pub q4: f32,
28623 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
28624 pub roll: f32,
28625 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
28626 pub pitch: f32,
28627 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
28628 pub yaw: f32,
28629 #[doc = "X acceleration"]
28630 pub xacc: f32,
28631 #[doc = "Y acceleration"]
28632 pub yacc: f32,
28633 #[doc = "Z acceleration"]
28634 pub zacc: f32,
28635 #[doc = "Angular speed around X axis"]
28636 pub xgyro: f32,
28637 #[doc = "Angular speed around Y axis"]
28638 pub ygyro: f32,
28639 #[doc = "Angular speed around Z axis"]
28640 pub zgyro: f32,
28641 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
28642 pub lat: f32,
28643 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
28644 pub lon: f32,
28645 #[doc = "Altitude"]
28646 pub alt: f32,
28647 #[doc = "Horizontal position standard deviation"]
28648 pub std_dev_horz: f32,
28649 #[doc = "Vertical position standard deviation"]
28650 pub std_dev_vert: f32,
28651 #[doc = "True velocity in north direction in earth-fixed NED frame"]
28652 pub vn: f32,
28653 #[doc = "True velocity in east direction in earth-fixed NED frame"]
28654 pub ve: f32,
28655 #[doc = "True velocity in down direction in earth-fixed NED frame"]
28656 pub vd: f32,
28657 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
28658 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28659 pub lat_int: i32,
28660 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
28661 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28662 pub lon_int: i32,
28663}
28664impl SIM_STATE_DATA {
28665 pub const ENCODED_LEN: usize = 92usize;
28666 pub const DEFAULT: Self = Self {
28667 q1: 0.0_f32,
28668 q2: 0.0_f32,
28669 q3: 0.0_f32,
28670 q4: 0.0_f32,
28671 roll: 0.0_f32,
28672 pitch: 0.0_f32,
28673 yaw: 0.0_f32,
28674 xacc: 0.0_f32,
28675 yacc: 0.0_f32,
28676 zacc: 0.0_f32,
28677 xgyro: 0.0_f32,
28678 ygyro: 0.0_f32,
28679 zgyro: 0.0_f32,
28680 lat: 0.0_f32,
28681 lon: 0.0_f32,
28682 alt: 0.0_f32,
28683 std_dev_horz: 0.0_f32,
28684 std_dev_vert: 0.0_f32,
28685 vn: 0.0_f32,
28686 ve: 0.0_f32,
28687 vd: 0.0_f32,
28688 lat_int: 0_i32,
28689 lon_int: 0_i32,
28690 };
28691 #[cfg(feature = "arbitrary")]
28692 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28693 use arbitrary::{Arbitrary, Unstructured};
28694 let mut buf = [0u8; 1024];
28695 rng.fill_bytes(&mut buf);
28696 let mut unstructured = Unstructured::new(&buf);
28697 Self::arbitrary(&mut unstructured).unwrap_or_default()
28698 }
28699}
28700impl Default for SIM_STATE_DATA {
28701 fn default() -> Self {
28702 Self::DEFAULT.clone()
28703 }
28704}
28705impl MessageData for SIM_STATE_DATA {
28706 type Message = MavMessage;
28707 const ID: u32 = 108u32;
28708 const NAME: &'static str = "SIM_STATE";
28709 const EXTRA_CRC: u8 = 32u8;
28710 const ENCODED_LEN: usize = 92usize;
28711 fn deser(
28712 _version: MavlinkVersion,
28713 __input: &[u8],
28714 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28715 let avail_len = __input.len();
28716 let mut payload_buf = [0; Self::ENCODED_LEN];
28717 let mut buf = if avail_len < Self::ENCODED_LEN {
28718 payload_buf[0..avail_len].copy_from_slice(__input);
28719 Bytes::new(&payload_buf)
28720 } else {
28721 Bytes::new(__input)
28722 };
28723 let mut __struct = Self::default();
28724 __struct.q1 = buf.get_f32_le();
28725 __struct.q2 = buf.get_f32_le();
28726 __struct.q3 = buf.get_f32_le();
28727 __struct.q4 = buf.get_f32_le();
28728 __struct.roll = buf.get_f32_le();
28729 __struct.pitch = buf.get_f32_le();
28730 __struct.yaw = buf.get_f32_le();
28731 __struct.xacc = buf.get_f32_le();
28732 __struct.yacc = buf.get_f32_le();
28733 __struct.zacc = buf.get_f32_le();
28734 __struct.xgyro = buf.get_f32_le();
28735 __struct.ygyro = buf.get_f32_le();
28736 __struct.zgyro = buf.get_f32_le();
28737 __struct.lat = buf.get_f32_le();
28738 __struct.lon = buf.get_f32_le();
28739 __struct.alt = buf.get_f32_le();
28740 __struct.std_dev_horz = buf.get_f32_le();
28741 __struct.std_dev_vert = buf.get_f32_le();
28742 __struct.vn = buf.get_f32_le();
28743 __struct.ve = buf.get_f32_le();
28744 __struct.vd = buf.get_f32_le();
28745 __struct.lat_int = buf.get_i32_le();
28746 __struct.lon_int = buf.get_i32_le();
28747 Ok(__struct)
28748 }
28749 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28750 let mut __tmp = BytesMut::new(bytes);
28751 #[allow(clippy::absurd_extreme_comparisons)]
28752 #[allow(unused_comparisons)]
28753 if __tmp.remaining() < Self::ENCODED_LEN {
28754 panic!(
28755 "buffer is too small (need {} bytes, but got {})",
28756 Self::ENCODED_LEN,
28757 __tmp.remaining(),
28758 )
28759 }
28760 __tmp.put_f32_le(self.q1);
28761 __tmp.put_f32_le(self.q2);
28762 __tmp.put_f32_le(self.q3);
28763 __tmp.put_f32_le(self.q4);
28764 __tmp.put_f32_le(self.roll);
28765 __tmp.put_f32_le(self.pitch);
28766 __tmp.put_f32_le(self.yaw);
28767 __tmp.put_f32_le(self.xacc);
28768 __tmp.put_f32_le(self.yacc);
28769 __tmp.put_f32_le(self.zacc);
28770 __tmp.put_f32_le(self.xgyro);
28771 __tmp.put_f32_le(self.ygyro);
28772 __tmp.put_f32_le(self.zgyro);
28773 __tmp.put_f32_le(self.lat);
28774 __tmp.put_f32_le(self.lon);
28775 __tmp.put_f32_le(self.alt);
28776 __tmp.put_f32_le(self.std_dev_horz);
28777 __tmp.put_f32_le(self.std_dev_vert);
28778 __tmp.put_f32_le(self.vn);
28779 __tmp.put_f32_le(self.ve);
28780 __tmp.put_f32_le(self.vd);
28781 if matches!(version, MavlinkVersion::V2) {
28782 __tmp.put_i32_le(self.lat_int);
28783 __tmp.put_i32_le(self.lon_int);
28784 let len = __tmp.len();
28785 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28786 } else {
28787 __tmp.len()
28788 }
28789 }
28790}
28791#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
28792#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
28793#[doc = ""]
28794#[doc = "ID: 370"]
28795#[derive(Debug, Clone, PartialEq)]
28796#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28798#[cfg_attr(feature = "ts", derive(TS))]
28799#[cfg_attr(feature = "ts", ts(export))]
28800pub struct SMART_BATTERY_INFO_DATA {
28801 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
28802 pub capacity_full_specification: i32,
28803 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
28804 pub capacity_full: i32,
28805 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
28806 pub cycle_count: u16,
28807 #[doc = "Battery weight. 0: field not provided."]
28808 pub weight: u16,
28809 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
28810 pub discharge_minimum_voltage: u16,
28811 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
28812 pub charging_minimum_voltage: u16,
28813 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
28814 pub resting_minimum_voltage: u16,
28815 #[doc = "Battery ID"]
28816 pub id: u8,
28817 #[doc = "Function of the battery"]
28818 pub battery_function: MavBatteryFunction,
28819 #[doc = "Type (chemistry) of the battery"]
28820 pub mavtype: MavBatteryType,
28821 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
28822 #[cfg_attr(feature = "ts", ts(type = "string"))]
28823 pub serial_number: CharArray<16>,
28824 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
28825 #[cfg_attr(feature = "ts", ts(type = "string"))]
28826 pub device_name: CharArray<50>,
28827 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
28828 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28829 pub charging_maximum_voltage: u16,
28830 #[doc = "Number of battery cells in series. 0: field not provided."]
28831 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28832 pub cells_in_series: u8,
28833 #[doc = "Maximum pack discharge current. 0: field not provided."]
28834 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28835 pub discharge_maximum_current: u32,
28836 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
28837 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28838 pub discharge_maximum_burst_current: u32,
28839 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
28840 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28841 #[cfg_attr(feature = "ts", ts(type = "string"))]
28842 pub manufacture_date: CharArray<11>,
28843}
28844impl SMART_BATTERY_INFO_DATA {
28845 pub const ENCODED_LEN: usize = 109usize;
28846 pub const DEFAULT: Self = Self {
28847 capacity_full_specification: 0_i32,
28848 capacity_full: 0_i32,
28849 cycle_count: 0_u16,
28850 weight: 0_u16,
28851 discharge_minimum_voltage: 0_u16,
28852 charging_minimum_voltage: 0_u16,
28853 resting_minimum_voltage: 0_u16,
28854 id: 0_u8,
28855 battery_function: MavBatteryFunction::DEFAULT,
28856 mavtype: MavBatteryType::DEFAULT,
28857 serial_number: CharArray::new([0_u8; 16usize]),
28858 device_name: CharArray::new([0_u8; 50usize]),
28859 charging_maximum_voltage: 0_u16,
28860 cells_in_series: 0_u8,
28861 discharge_maximum_current: 0_u32,
28862 discharge_maximum_burst_current: 0_u32,
28863 manufacture_date: CharArray::new([0_u8; 11usize]),
28864 };
28865 #[cfg(feature = "arbitrary")]
28866 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28867 use arbitrary::{Arbitrary, Unstructured};
28868 let mut buf = [0u8; 1024];
28869 rng.fill_bytes(&mut buf);
28870 let mut unstructured = Unstructured::new(&buf);
28871 Self::arbitrary(&mut unstructured).unwrap_or_default()
28872 }
28873}
28874impl Default for SMART_BATTERY_INFO_DATA {
28875 fn default() -> Self {
28876 Self::DEFAULT.clone()
28877 }
28878}
28879impl MessageData for SMART_BATTERY_INFO_DATA {
28880 type Message = MavMessage;
28881 const ID: u32 = 370u32;
28882 const NAME: &'static str = "SMART_BATTERY_INFO";
28883 const EXTRA_CRC: u8 = 75u8;
28884 const ENCODED_LEN: usize = 109usize;
28885 fn deser(
28886 _version: MavlinkVersion,
28887 __input: &[u8],
28888 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28889 let avail_len = __input.len();
28890 let mut payload_buf = [0; Self::ENCODED_LEN];
28891 let mut buf = if avail_len < Self::ENCODED_LEN {
28892 payload_buf[0..avail_len].copy_from_slice(__input);
28893 Bytes::new(&payload_buf)
28894 } else {
28895 Bytes::new(__input)
28896 };
28897 let mut __struct = Self::default();
28898 __struct.capacity_full_specification = buf.get_i32_le();
28899 __struct.capacity_full = buf.get_i32_le();
28900 __struct.cycle_count = buf.get_u16_le();
28901 __struct.weight = buf.get_u16_le();
28902 __struct.discharge_minimum_voltage = buf.get_u16_le();
28903 __struct.charging_minimum_voltage = buf.get_u16_le();
28904 __struct.resting_minimum_voltage = buf.get_u16_le();
28905 __struct.id = buf.get_u8();
28906 let tmp = buf.get_u8();
28907 __struct.battery_function =
28908 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28909 enum_type: "MavBatteryFunction",
28910 value: tmp as u64,
28911 })?;
28912 let tmp = buf.get_u8();
28913 __struct.mavtype =
28914 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28915 enum_type: "MavBatteryType",
28916 value: tmp as u64,
28917 })?;
28918 let mut tmp = [0_u8; 16usize];
28919 for v in &mut tmp {
28920 *v = buf.get_u8();
28921 }
28922 __struct.serial_number = CharArray::new(tmp);
28923 let mut tmp = [0_u8; 50usize];
28924 for v in &mut tmp {
28925 *v = buf.get_u8();
28926 }
28927 __struct.device_name = CharArray::new(tmp);
28928 __struct.charging_maximum_voltage = buf.get_u16_le();
28929 __struct.cells_in_series = buf.get_u8();
28930 __struct.discharge_maximum_current = buf.get_u32_le();
28931 __struct.discharge_maximum_burst_current = buf.get_u32_le();
28932 let mut tmp = [0_u8; 11usize];
28933 for v in &mut tmp {
28934 *v = buf.get_u8();
28935 }
28936 __struct.manufacture_date = CharArray::new(tmp);
28937 Ok(__struct)
28938 }
28939 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28940 let mut __tmp = BytesMut::new(bytes);
28941 #[allow(clippy::absurd_extreme_comparisons)]
28942 #[allow(unused_comparisons)]
28943 if __tmp.remaining() < Self::ENCODED_LEN {
28944 panic!(
28945 "buffer is too small (need {} bytes, but got {})",
28946 Self::ENCODED_LEN,
28947 __tmp.remaining(),
28948 )
28949 }
28950 __tmp.put_i32_le(self.capacity_full_specification);
28951 __tmp.put_i32_le(self.capacity_full);
28952 __tmp.put_u16_le(self.cycle_count);
28953 __tmp.put_u16_le(self.weight);
28954 __tmp.put_u16_le(self.discharge_minimum_voltage);
28955 __tmp.put_u16_le(self.charging_minimum_voltage);
28956 __tmp.put_u16_le(self.resting_minimum_voltage);
28957 __tmp.put_u8(self.id);
28958 __tmp.put_u8(self.battery_function as u8);
28959 __tmp.put_u8(self.mavtype as u8);
28960 for val in &self.serial_number {
28961 __tmp.put_u8(*val);
28962 }
28963 for val in &self.device_name {
28964 __tmp.put_u8(*val);
28965 }
28966 if matches!(version, MavlinkVersion::V2) {
28967 __tmp.put_u16_le(self.charging_maximum_voltage);
28968 __tmp.put_u8(self.cells_in_series);
28969 __tmp.put_u32_le(self.discharge_maximum_current);
28970 __tmp.put_u32_le(self.discharge_maximum_burst_current);
28971 for val in &self.manufacture_date {
28972 __tmp.put_u8(*val);
28973 }
28974 let len = __tmp.len();
28975 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28976 } else {
28977 __tmp.len()
28978 }
28979 }
28980}
28981#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
28982#[doc = ""]
28983#[doc = "ID: 253"]
28984#[derive(Debug, Clone, PartialEq)]
28985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28987#[cfg_attr(feature = "ts", derive(TS))]
28988#[cfg_attr(feature = "ts", ts(export))]
28989pub struct STATUSTEXT_DATA {
28990 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
28991 pub severity: MavSeverity,
28992 #[doc = "Status text message, without null termination character"]
28993 #[cfg_attr(feature = "ts", ts(type = "string"))]
28994 pub text: CharArray<50>,
28995 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
28996 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28997 pub id: u16,
28998 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
28999 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29000 pub chunk_seq: u8,
29001}
29002impl STATUSTEXT_DATA {
29003 pub const ENCODED_LEN: usize = 54usize;
29004 pub const DEFAULT: Self = Self {
29005 severity: MavSeverity::DEFAULT,
29006 text: CharArray::new([0_u8; 50usize]),
29007 id: 0_u16,
29008 chunk_seq: 0_u8,
29009 };
29010 #[cfg(feature = "arbitrary")]
29011 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29012 use arbitrary::{Arbitrary, Unstructured};
29013 let mut buf = [0u8; 1024];
29014 rng.fill_bytes(&mut buf);
29015 let mut unstructured = Unstructured::new(&buf);
29016 Self::arbitrary(&mut unstructured).unwrap_or_default()
29017 }
29018}
29019impl Default for STATUSTEXT_DATA {
29020 fn default() -> Self {
29021 Self::DEFAULT.clone()
29022 }
29023}
29024impl MessageData for STATUSTEXT_DATA {
29025 type Message = MavMessage;
29026 const ID: u32 = 253u32;
29027 const NAME: &'static str = "STATUSTEXT";
29028 const EXTRA_CRC: u8 = 83u8;
29029 const ENCODED_LEN: usize = 54usize;
29030 fn deser(
29031 _version: MavlinkVersion,
29032 __input: &[u8],
29033 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29034 let avail_len = __input.len();
29035 let mut payload_buf = [0; Self::ENCODED_LEN];
29036 let mut buf = if avail_len < Self::ENCODED_LEN {
29037 payload_buf[0..avail_len].copy_from_slice(__input);
29038 Bytes::new(&payload_buf)
29039 } else {
29040 Bytes::new(__input)
29041 };
29042 let mut __struct = Self::default();
29043 let tmp = buf.get_u8();
29044 __struct.severity =
29045 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29046 enum_type: "MavSeverity",
29047 value: tmp as u64,
29048 })?;
29049 let mut tmp = [0_u8; 50usize];
29050 for v in &mut tmp {
29051 *v = buf.get_u8();
29052 }
29053 __struct.text = CharArray::new(tmp);
29054 __struct.id = buf.get_u16_le();
29055 __struct.chunk_seq = buf.get_u8();
29056 Ok(__struct)
29057 }
29058 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29059 let mut __tmp = BytesMut::new(bytes);
29060 #[allow(clippy::absurd_extreme_comparisons)]
29061 #[allow(unused_comparisons)]
29062 if __tmp.remaining() < Self::ENCODED_LEN {
29063 panic!(
29064 "buffer is too small (need {} bytes, but got {})",
29065 Self::ENCODED_LEN,
29066 __tmp.remaining(),
29067 )
29068 }
29069 __tmp.put_u8(self.severity as u8);
29070 for val in &self.text {
29071 __tmp.put_u8(*val);
29072 }
29073 if matches!(version, MavlinkVersion::V2) {
29074 __tmp.put_u16_le(self.id);
29075 __tmp.put_u8(self.chunk_seq);
29076 let len = __tmp.len();
29077 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29078 } else {
29079 __tmp.len()
29080 }
29081 }
29082}
29083#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
29084#[doc = ""]
29085#[doc = "ID: 261"]
29086#[derive(Debug, Clone, PartialEq)]
29087#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29089#[cfg_attr(feature = "ts", derive(TS))]
29090#[cfg_attr(feature = "ts", ts(export))]
29091pub struct STORAGE_INFORMATION_DATA {
29092 #[doc = "Timestamp (time since system boot)."]
29093 pub time_boot_ms: u32,
29094 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29095 pub total_capacity: f32,
29096 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29097 pub used_capacity: f32,
29098 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29099 pub available_capacity: f32,
29100 #[doc = "Read speed."]
29101 pub read_speed: f32,
29102 #[doc = "Write speed."]
29103 pub write_speed: f32,
29104 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
29105 pub storage_id: u8,
29106 #[doc = "Number of storage devices"]
29107 pub storage_count: u8,
29108 #[doc = "Status of storage"]
29109 pub status: StorageStatus,
29110 #[doc = "Type of storage"]
29111 #[cfg_attr(feature = "serde", serde(default))]
29112 pub mavtype: StorageType,
29113 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
29114 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29115 #[cfg_attr(feature = "ts", ts(type = "string"))]
29116 pub name: CharArray<32>,
29117 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
29118 #[cfg_attr(feature = "serde", serde(default))]
29119 pub storage_usage: StorageUsageFlag,
29120}
29121impl STORAGE_INFORMATION_DATA {
29122 pub const ENCODED_LEN: usize = 61usize;
29123 pub const DEFAULT: Self = Self {
29124 time_boot_ms: 0_u32,
29125 total_capacity: 0.0_f32,
29126 used_capacity: 0.0_f32,
29127 available_capacity: 0.0_f32,
29128 read_speed: 0.0_f32,
29129 write_speed: 0.0_f32,
29130 storage_id: 0_u8,
29131 storage_count: 0_u8,
29132 status: StorageStatus::DEFAULT,
29133 mavtype: StorageType::DEFAULT,
29134 name: CharArray::new([0_u8; 32usize]),
29135 storage_usage: StorageUsageFlag::DEFAULT,
29136 };
29137 #[cfg(feature = "arbitrary")]
29138 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29139 use arbitrary::{Arbitrary, Unstructured};
29140 let mut buf = [0u8; 1024];
29141 rng.fill_bytes(&mut buf);
29142 let mut unstructured = Unstructured::new(&buf);
29143 Self::arbitrary(&mut unstructured).unwrap_or_default()
29144 }
29145}
29146impl Default for STORAGE_INFORMATION_DATA {
29147 fn default() -> Self {
29148 Self::DEFAULT.clone()
29149 }
29150}
29151impl MessageData for STORAGE_INFORMATION_DATA {
29152 type Message = MavMessage;
29153 const ID: u32 = 261u32;
29154 const NAME: &'static str = "STORAGE_INFORMATION";
29155 const EXTRA_CRC: u8 = 179u8;
29156 const ENCODED_LEN: usize = 61usize;
29157 fn deser(
29158 _version: MavlinkVersion,
29159 __input: &[u8],
29160 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29161 let avail_len = __input.len();
29162 let mut payload_buf = [0; Self::ENCODED_LEN];
29163 let mut buf = if avail_len < Self::ENCODED_LEN {
29164 payload_buf[0..avail_len].copy_from_slice(__input);
29165 Bytes::new(&payload_buf)
29166 } else {
29167 Bytes::new(__input)
29168 };
29169 let mut __struct = Self::default();
29170 __struct.time_boot_ms = buf.get_u32_le();
29171 __struct.total_capacity = buf.get_f32_le();
29172 __struct.used_capacity = buf.get_f32_le();
29173 __struct.available_capacity = buf.get_f32_le();
29174 __struct.read_speed = buf.get_f32_le();
29175 __struct.write_speed = buf.get_f32_le();
29176 __struct.storage_id = buf.get_u8();
29177 __struct.storage_count = buf.get_u8();
29178 let tmp = buf.get_u8();
29179 __struct.status =
29180 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29181 enum_type: "StorageStatus",
29182 value: tmp as u64,
29183 })?;
29184 let tmp = buf.get_u8();
29185 __struct.mavtype =
29186 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29187 enum_type: "StorageType",
29188 value: tmp as u64,
29189 })?;
29190 let mut tmp = [0_u8; 32usize];
29191 for v in &mut tmp {
29192 *v = buf.get_u8();
29193 }
29194 __struct.name = CharArray::new(tmp);
29195 let tmp = buf.get_u8();
29196 __struct.storage_usage = StorageUsageFlag::from_bits(
29197 tmp as <StorageUsageFlag as Flags>::Bits,
29198 )
29199 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29200 flag_type: "StorageUsageFlag",
29201 value: tmp as u64,
29202 })?;
29203 Ok(__struct)
29204 }
29205 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29206 let mut __tmp = BytesMut::new(bytes);
29207 #[allow(clippy::absurd_extreme_comparisons)]
29208 #[allow(unused_comparisons)]
29209 if __tmp.remaining() < Self::ENCODED_LEN {
29210 panic!(
29211 "buffer is too small (need {} bytes, but got {})",
29212 Self::ENCODED_LEN,
29213 __tmp.remaining(),
29214 )
29215 }
29216 __tmp.put_u32_le(self.time_boot_ms);
29217 __tmp.put_f32_le(self.total_capacity);
29218 __tmp.put_f32_le(self.used_capacity);
29219 __tmp.put_f32_le(self.available_capacity);
29220 __tmp.put_f32_le(self.read_speed);
29221 __tmp.put_f32_le(self.write_speed);
29222 __tmp.put_u8(self.storage_id);
29223 __tmp.put_u8(self.storage_count);
29224 __tmp.put_u8(self.status as u8);
29225 if matches!(version, MavlinkVersion::V2) {
29226 __tmp.put_u8(self.mavtype as u8);
29227 for val in &self.name {
29228 __tmp.put_u8(*val);
29229 }
29230 __tmp.put_u8(self.storage_usage.bits() as u8);
29231 let len = __tmp.len();
29232 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29233 } else {
29234 __tmp.len()
29235 }
29236 }
29237}
29238#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
29239#[doc = ""]
29240#[doc = "ID: 401"]
29241#[derive(Debug, Clone, PartialEq)]
29242#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29244#[cfg_attr(feature = "ts", derive(TS))]
29245#[cfg_attr(feature = "ts", ts(export))]
29246pub struct SUPPORTED_TUNES_DATA {
29247 #[doc = "Bitfield of supported tune formats."]
29248 pub format: TuneFormat,
29249 #[doc = "System ID"]
29250 pub target_system: u8,
29251 #[doc = "Component ID"]
29252 pub target_component: u8,
29253}
29254impl SUPPORTED_TUNES_DATA {
29255 pub const ENCODED_LEN: usize = 6usize;
29256 pub const DEFAULT: Self = Self {
29257 format: TuneFormat::DEFAULT,
29258 target_system: 0_u8,
29259 target_component: 0_u8,
29260 };
29261 #[cfg(feature = "arbitrary")]
29262 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29263 use arbitrary::{Arbitrary, Unstructured};
29264 let mut buf = [0u8; 1024];
29265 rng.fill_bytes(&mut buf);
29266 let mut unstructured = Unstructured::new(&buf);
29267 Self::arbitrary(&mut unstructured).unwrap_or_default()
29268 }
29269}
29270impl Default for SUPPORTED_TUNES_DATA {
29271 fn default() -> Self {
29272 Self::DEFAULT.clone()
29273 }
29274}
29275impl MessageData for SUPPORTED_TUNES_DATA {
29276 type Message = MavMessage;
29277 const ID: u32 = 401u32;
29278 const NAME: &'static str = "SUPPORTED_TUNES";
29279 const EXTRA_CRC: u8 = 183u8;
29280 const ENCODED_LEN: usize = 6usize;
29281 fn deser(
29282 _version: MavlinkVersion,
29283 __input: &[u8],
29284 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29285 let avail_len = __input.len();
29286 let mut payload_buf = [0; Self::ENCODED_LEN];
29287 let mut buf = if avail_len < Self::ENCODED_LEN {
29288 payload_buf[0..avail_len].copy_from_slice(__input);
29289 Bytes::new(&payload_buf)
29290 } else {
29291 Bytes::new(__input)
29292 };
29293 let mut __struct = Self::default();
29294 let tmp = buf.get_u32_le();
29295 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
29296 ::mavlink_core::error::ParserError::InvalidEnum {
29297 enum_type: "TuneFormat",
29298 value: tmp as u64,
29299 },
29300 )?;
29301 __struct.target_system = buf.get_u8();
29302 __struct.target_component = buf.get_u8();
29303 Ok(__struct)
29304 }
29305 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29306 let mut __tmp = BytesMut::new(bytes);
29307 #[allow(clippy::absurd_extreme_comparisons)]
29308 #[allow(unused_comparisons)]
29309 if __tmp.remaining() < Self::ENCODED_LEN {
29310 panic!(
29311 "buffer is too small (need {} bytes, but got {})",
29312 Self::ENCODED_LEN,
29313 __tmp.remaining(),
29314 )
29315 }
29316 __tmp.put_u32_le(self.format as u32);
29317 __tmp.put_u8(self.target_system);
29318 __tmp.put_u8(self.target_component);
29319 if matches!(version, MavlinkVersion::V2) {
29320 let len = __tmp.len();
29321 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29322 } else {
29323 __tmp.len()
29324 }
29325 }
29326}
29327#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
29328#[doc = ""]
29329#[doc = "ID: 2"]
29330#[derive(Debug, Clone, PartialEq)]
29331#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29332#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29333#[cfg_attr(feature = "ts", derive(TS))]
29334#[cfg_attr(feature = "ts", ts(export))]
29335pub struct SYSTEM_TIME_DATA {
29336 #[doc = "Timestamp (UNIX epoch time)."]
29337 pub time_unix_usec: u64,
29338 #[doc = "Timestamp (time since system boot)."]
29339 pub time_boot_ms: u32,
29340}
29341impl SYSTEM_TIME_DATA {
29342 pub const ENCODED_LEN: usize = 12usize;
29343 pub const DEFAULT: Self = Self {
29344 time_unix_usec: 0_u64,
29345 time_boot_ms: 0_u32,
29346 };
29347 #[cfg(feature = "arbitrary")]
29348 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29349 use arbitrary::{Arbitrary, Unstructured};
29350 let mut buf = [0u8; 1024];
29351 rng.fill_bytes(&mut buf);
29352 let mut unstructured = Unstructured::new(&buf);
29353 Self::arbitrary(&mut unstructured).unwrap_or_default()
29354 }
29355}
29356impl Default for SYSTEM_TIME_DATA {
29357 fn default() -> Self {
29358 Self::DEFAULT.clone()
29359 }
29360}
29361impl MessageData for SYSTEM_TIME_DATA {
29362 type Message = MavMessage;
29363 const ID: u32 = 2u32;
29364 const NAME: &'static str = "SYSTEM_TIME";
29365 const EXTRA_CRC: u8 = 137u8;
29366 const ENCODED_LEN: usize = 12usize;
29367 fn deser(
29368 _version: MavlinkVersion,
29369 __input: &[u8],
29370 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29371 let avail_len = __input.len();
29372 let mut payload_buf = [0; Self::ENCODED_LEN];
29373 let mut buf = if avail_len < Self::ENCODED_LEN {
29374 payload_buf[0..avail_len].copy_from_slice(__input);
29375 Bytes::new(&payload_buf)
29376 } else {
29377 Bytes::new(__input)
29378 };
29379 let mut __struct = Self::default();
29380 __struct.time_unix_usec = buf.get_u64_le();
29381 __struct.time_boot_ms = buf.get_u32_le();
29382 Ok(__struct)
29383 }
29384 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29385 let mut __tmp = BytesMut::new(bytes);
29386 #[allow(clippy::absurd_extreme_comparisons)]
29387 #[allow(unused_comparisons)]
29388 if __tmp.remaining() < Self::ENCODED_LEN {
29389 panic!(
29390 "buffer is too small (need {} bytes, but got {})",
29391 Self::ENCODED_LEN,
29392 __tmp.remaining(),
29393 )
29394 }
29395 __tmp.put_u64_le(self.time_unix_usec);
29396 __tmp.put_u32_le(self.time_boot_ms);
29397 if matches!(version, MavlinkVersion::V2) {
29398 let len = __tmp.len();
29399 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29400 } else {
29401 __tmp.len()
29402 }
29403 }
29404}
29405#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
29406#[doc = ""]
29407#[doc = "ID: 1"]
29408#[derive(Debug, Clone, PartialEq)]
29409#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29410#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29411#[cfg_attr(feature = "ts", derive(TS))]
29412#[cfg_attr(feature = "ts", ts(export))]
29413pub struct SYS_STATUS_DATA {
29414 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29415 pub onboard_control_sensors_present: MavSysStatusSensor,
29416 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29417 pub onboard_control_sensors_enabled: MavSysStatusSensor,
29418 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29419 pub onboard_control_sensors_health: MavSysStatusSensor,
29420 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
29421 pub load: u16,
29422 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
29423 pub voltage_battery: u16,
29424 #[doc = "Battery current, -1: Current not sent by autopilot"]
29425 pub current_battery: i16,
29426 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29427 pub drop_rate_comm: u16,
29428 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29429 pub errors_comm: u16,
29430 #[doc = "Autopilot-specific errors"]
29431 pub errors_count1: u16,
29432 #[doc = "Autopilot-specific errors"]
29433 pub errors_count2: u16,
29434 #[doc = "Autopilot-specific errors"]
29435 pub errors_count3: u16,
29436 #[doc = "Autopilot-specific errors"]
29437 pub errors_count4: u16,
29438 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
29439 pub battery_remaining: i8,
29440 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29441 #[cfg_attr(feature = "serde", serde(default))]
29442 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
29443 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29444 #[cfg_attr(feature = "serde", serde(default))]
29445 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
29446 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29447 #[cfg_attr(feature = "serde", serde(default))]
29448 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
29449}
29450impl SYS_STATUS_DATA {
29451 pub const ENCODED_LEN: usize = 43usize;
29452 pub const DEFAULT: Self = Self {
29453 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
29454 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
29455 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
29456 load: 0_u16,
29457 voltage_battery: 0_u16,
29458 current_battery: 0_i16,
29459 drop_rate_comm: 0_u16,
29460 errors_comm: 0_u16,
29461 errors_count1: 0_u16,
29462 errors_count2: 0_u16,
29463 errors_count3: 0_u16,
29464 errors_count4: 0_u16,
29465 battery_remaining: 0_i8,
29466 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
29467 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
29468 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
29469 };
29470 #[cfg(feature = "arbitrary")]
29471 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29472 use arbitrary::{Arbitrary, Unstructured};
29473 let mut buf = [0u8; 1024];
29474 rng.fill_bytes(&mut buf);
29475 let mut unstructured = Unstructured::new(&buf);
29476 Self::arbitrary(&mut unstructured).unwrap_or_default()
29477 }
29478}
29479impl Default for SYS_STATUS_DATA {
29480 fn default() -> Self {
29481 Self::DEFAULT.clone()
29482 }
29483}
29484impl MessageData for SYS_STATUS_DATA {
29485 type Message = MavMessage;
29486 const ID: u32 = 1u32;
29487 const NAME: &'static str = "SYS_STATUS";
29488 const EXTRA_CRC: u8 = 124u8;
29489 const ENCODED_LEN: usize = 43usize;
29490 fn deser(
29491 _version: MavlinkVersion,
29492 __input: &[u8],
29493 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29494 let avail_len = __input.len();
29495 let mut payload_buf = [0; Self::ENCODED_LEN];
29496 let mut buf = if avail_len < Self::ENCODED_LEN {
29497 payload_buf[0..avail_len].copy_from_slice(__input);
29498 Bytes::new(&payload_buf)
29499 } else {
29500 Bytes::new(__input)
29501 };
29502 let mut __struct = Self::default();
29503 let tmp = buf.get_u32_le();
29504 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
29505 tmp as <MavSysStatusSensor as Flags>::Bits,
29506 )
29507 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29508 flag_type: "MavSysStatusSensor",
29509 value: tmp as u64,
29510 })?;
29511 let tmp = buf.get_u32_le();
29512 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
29513 tmp as <MavSysStatusSensor as Flags>::Bits,
29514 )
29515 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29516 flag_type: "MavSysStatusSensor",
29517 value: tmp as u64,
29518 })?;
29519 let tmp = buf.get_u32_le();
29520 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
29521 tmp as <MavSysStatusSensor as Flags>::Bits,
29522 )
29523 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29524 flag_type: "MavSysStatusSensor",
29525 value: tmp as u64,
29526 })?;
29527 __struct.load = buf.get_u16_le();
29528 __struct.voltage_battery = buf.get_u16_le();
29529 __struct.current_battery = buf.get_i16_le();
29530 __struct.drop_rate_comm = buf.get_u16_le();
29531 __struct.errors_comm = buf.get_u16_le();
29532 __struct.errors_count1 = buf.get_u16_le();
29533 __struct.errors_count2 = buf.get_u16_le();
29534 __struct.errors_count3 = buf.get_u16_le();
29535 __struct.errors_count4 = buf.get_u16_le();
29536 __struct.battery_remaining = buf.get_i8();
29537 let tmp = buf.get_u32_le();
29538 __struct.onboard_control_sensors_present_extended = MavSysStatusSensorExtended::from_bits(
29539 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
29540 )
29541 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29542 flag_type: "MavSysStatusSensorExtended",
29543 value: tmp as u64,
29544 })?;
29545 let tmp = buf.get_u32_le();
29546 __struct.onboard_control_sensors_enabled_extended = MavSysStatusSensorExtended::from_bits(
29547 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
29548 )
29549 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29550 flag_type: "MavSysStatusSensorExtended",
29551 value: tmp as u64,
29552 })?;
29553 let tmp = buf.get_u32_le();
29554 __struct.onboard_control_sensors_health_extended = MavSysStatusSensorExtended::from_bits(
29555 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
29556 )
29557 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29558 flag_type: "MavSysStatusSensorExtended",
29559 value: tmp as u64,
29560 })?;
29561 Ok(__struct)
29562 }
29563 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29564 let mut __tmp = BytesMut::new(bytes);
29565 #[allow(clippy::absurd_extreme_comparisons)]
29566 #[allow(unused_comparisons)]
29567 if __tmp.remaining() < Self::ENCODED_LEN {
29568 panic!(
29569 "buffer is too small (need {} bytes, but got {})",
29570 Self::ENCODED_LEN,
29571 __tmp.remaining(),
29572 )
29573 }
29574 __tmp.put_u32_le(self.onboard_control_sensors_present.bits() as u32);
29575 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits() as u32);
29576 __tmp.put_u32_le(self.onboard_control_sensors_health.bits() as u32);
29577 __tmp.put_u16_le(self.load);
29578 __tmp.put_u16_le(self.voltage_battery);
29579 __tmp.put_i16_le(self.current_battery);
29580 __tmp.put_u16_le(self.drop_rate_comm);
29581 __tmp.put_u16_le(self.errors_comm);
29582 __tmp.put_u16_le(self.errors_count1);
29583 __tmp.put_u16_le(self.errors_count2);
29584 __tmp.put_u16_le(self.errors_count3);
29585 __tmp.put_u16_le(self.errors_count4);
29586 __tmp.put_i8(self.battery_remaining);
29587 if matches!(version, MavlinkVersion::V2) {
29588 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits() as u32);
29589 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits() as u32);
29590 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits() as u32);
29591 let len = __tmp.len();
29592 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29593 } else {
29594 __tmp.len()
29595 }
29596 }
29597}
29598#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
29599#[doc = ""]
29600#[doc = "ID: 135"]
29601#[derive(Debug, Clone, PartialEq)]
29602#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29603#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29604#[cfg_attr(feature = "ts", derive(TS))]
29605#[cfg_attr(feature = "ts", ts(export))]
29606pub struct TERRAIN_CHECK_DATA {
29607 #[doc = "Latitude"]
29608 pub lat: i32,
29609 #[doc = "Longitude"]
29610 pub lon: i32,
29611}
29612impl TERRAIN_CHECK_DATA {
29613 pub const ENCODED_LEN: usize = 8usize;
29614 pub const DEFAULT: Self = Self {
29615 lat: 0_i32,
29616 lon: 0_i32,
29617 };
29618 #[cfg(feature = "arbitrary")]
29619 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29620 use arbitrary::{Arbitrary, Unstructured};
29621 let mut buf = [0u8; 1024];
29622 rng.fill_bytes(&mut buf);
29623 let mut unstructured = Unstructured::new(&buf);
29624 Self::arbitrary(&mut unstructured).unwrap_or_default()
29625 }
29626}
29627impl Default for TERRAIN_CHECK_DATA {
29628 fn default() -> Self {
29629 Self::DEFAULT.clone()
29630 }
29631}
29632impl MessageData for TERRAIN_CHECK_DATA {
29633 type Message = MavMessage;
29634 const ID: u32 = 135u32;
29635 const NAME: &'static str = "TERRAIN_CHECK";
29636 const EXTRA_CRC: u8 = 203u8;
29637 const ENCODED_LEN: usize = 8usize;
29638 fn deser(
29639 _version: MavlinkVersion,
29640 __input: &[u8],
29641 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29642 let avail_len = __input.len();
29643 let mut payload_buf = [0; Self::ENCODED_LEN];
29644 let mut buf = if avail_len < Self::ENCODED_LEN {
29645 payload_buf[0..avail_len].copy_from_slice(__input);
29646 Bytes::new(&payload_buf)
29647 } else {
29648 Bytes::new(__input)
29649 };
29650 let mut __struct = Self::default();
29651 __struct.lat = buf.get_i32_le();
29652 __struct.lon = buf.get_i32_le();
29653 Ok(__struct)
29654 }
29655 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29656 let mut __tmp = BytesMut::new(bytes);
29657 #[allow(clippy::absurd_extreme_comparisons)]
29658 #[allow(unused_comparisons)]
29659 if __tmp.remaining() < Self::ENCODED_LEN {
29660 panic!(
29661 "buffer is too small (need {} bytes, but got {})",
29662 Self::ENCODED_LEN,
29663 __tmp.remaining(),
29664 )
29665 }
29666 __tmp.put_i32_le(self.lat);
29667 __tmp.put_i32_le(self.lon);
29668 if matches!(version, MavlinkVersion::V2) {
29669 let len = __tmp.len();
29670 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29671 } else {
29672 __tmp.len()
29673 }
29674 }
29675}
29676#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29677#[doc = ""]
29678#[doc = "ID: 134"]
29679#[derive(Debug, Clone, PartialEq)]
29680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29681#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29682#[cfg_attr(feature = "ts", derive(TS))]
29683#[cfg_attr(feature = "ts", ts(export))]
29684pub struct TERRAIN_DATA_DATA {
29685 #[doc = "Latitude of SW corner of first grid"]
29686 pub lat: i32,
29687 #[doc = "Longitude of SW corner of first grid"]
29688 pub lon: i32,
29689 #[doc = "Grid spacing"]
29690 pub grid_spacing: u16,
29691 #[doc = "Terrain data MSL"]
29692 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29693 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29694 pub data: [i16; 16],
29695 #[doc = "bit within the terrain request mask"]
29696 pub gridbit: u8,
29697}
29698impl TERRAIN_DATA_DATA {
29699 pub const ENCODED_LEN: usize = 43usize;
29700 pub const DEFAULT: Self = Self {
29701 lat: 0_i32,
29702 lon: 0_i32,
29703 grid_spacing: 0_u16,
29704 data: [0_i16; 16usize],
29705 gridbit: 0_u8,
29706 };
29707 #[cfg(feature = "arbitrary")]
29708 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29709 use arbitrary::{Arbitrary, Unstructured};
29710 let mut buf = [0u8; 1024];
29711 rng.fill_bytes(&mut buf);
29712 let mut unstructured = Unstructured::new(&buf);
29713 Self::arbitrary(&mut unstructured).unwrap_or_default()
29714 }
29715}
29716impl Default for TERRAIN_DATA_DATA {
29717 fn default() -> Self {
29718 Self::DEFAULT.clone()
29719 }
29720}
29721impl MessageData for TERRAIN_DATA_DATA {
29722 type Message = MavMessage;
29723 const ID: u32 = 134u32;
29724 const NAME: &'static str = "TERRAIN_DATA";
29725 const EXTRA_CRC: u8 = 229u8;
29726 const ENCODED_LEN: usize = 43usize;
29727 fn deser(
29728 _version: MavlinkVersion,
29729 __input: &[u8],
29730 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29731 let avail_len = __input.len();
29732 let mut payload_buf = [0; Self::ENCODED_LEN];
29733 let mut buf = if avail_len < Self::ENCODED_LEN {
29734 payload_buf[0..avail_len].copy_from_slice(__input);
29735 Bytes::new(&payload_buf)
29736 } else {
29737 Bytes::new(__input)
29738 };
29739 let mut __struct = Self::default();
29740 __struct.lat = buf.get_i32_le();
29741 __struct.lon = buf.get_i32_le();
29742 __struct.grid_spacing = buf.get_u16_le();
29743 for v in &mut __struct.data {
29744 let val = buf.get_i16_le();
29745 *v = val;
29746 }
29747 __struct.gridbit = buf.get_u8();
29748 Ok(__struct)
29749 }
29750 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29751 let mut __tmp = BytesMut::new(bytes);
29752 #[allow(clippy::absurd_extreme_comparisons)]
29753 #[allow(unused_comparisons)]
29754 if __tmp.remaining() < Self::ENCODED_LEN {
29755 panic!(
29756 "buffer is too small (need {} bytes, but got {})",
29757 Self::ENCODED_LEN,
29758 __tmp.remaining(),
29759 )
29760 }
29761 __tmp.put_i32_le(self.lat);
29762 __tmp.put_i32_le(self.lon);
29763 __tmp.put_u16_le(self.grid_spacing);
29764 for val in &self.data {
29765 __tmp.put_i16_le(*val);
29766 }
29767 __tmp.put_u8(self.gridbit);
29768 if matches!(version, MavlinkVersion::V2) {
29769 let len = __tmp.len();
29770 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29771 } else {
29772 __tmp.len()
29773 }
29774 }
29775}
29776#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29777#[doc = ""]
29778#[doc = "ID: 136"]
29779#[derive(Debug, Clone, PartialEq)]
29780#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29781#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29782#[cfg_attr(feature = "ts", derive(TS))]
29783#[cfg_attr(feature = "ts", ts(export))]
29784pub struct TERRAIN_REPORT_DATA {
29785 #[doc = "Latitude"]
29786 pub lat: i32,
29787 #[doc = "Longitude"]
29788 pub lon: i32,
29789 #[doc = "Terrain height MSL"]
29790 pub terrain_height: f32,
29791 #[doc = "Current vehicle height above lat/lon terrain height"]
29792 pub current_height: f32,
29793 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
29794 pub spacing: u16,
29795 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
29796 pub pending: u16,
29797 #[doc = "Number of 4x4 terrain blocks in memory"]
29798 pub loaded: u16,
29799}
29800impl TERRAIN_REPORT_DATA {
29801 pub const ENCODED_LEN: usize = 22usize;
29802 pub const DEFAULT: Self = Self {
29803 lat: 0_i32,
29804 lon: 0_i32,
29805 terrain_height: 0.0_f32,
29806 current_height: 0.0_f32,
29807 spacing: 0_u16,
29808 pending: 0_u16,
29809 loaded: 0_u16,
29810 };
29811 #[cfg(feature = "arbitrary")]
29812 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29813 use arbitrary::{Arbitrary, Unstructured};
29814 let mut buf = [0u8; 1024];
29815 rng.fill_bytes(&mut buf);
29816 let mut unstructured = Unstructured::new(&buf);
29817 Self::arbitrary(&mut unstructured).unwrap_or_default()
29818 }
29819}
29820impl Default for TERRAIN_REPORT_DATA {
29821 fn default() -> Self {
29822 Self::DEFAULT.clone()
29823 }
29824}
29825impl MessageData for TERRAIN_REPORT_DATA {
29826 type Message = MavMessage;
29827 const ID: u32 = 136u32;
29828 const NAME: &'static str = "TERRAIN_REPORT";
29829 const EXTRA_CRC: u8 = 1u8;
29830 const ENCODED_LEN: usize = 22usize;
29831 fn deser(
29832 _version: MavlinkVersion,
29833 __input: &[u8],
29834 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29835 let avail_len = __input.len();
29836 let mut payload_buf = [0; Self::ENCODED_LEN];
29837 let mut buf = if avail_len < Self::ENCODED_LEN {
29838 payload_buf[0..avail_len].copy_from_slice(__input);
29839 Bytes::new(&payload_buf)
29840 } else {
29841 Bytes::new(__input)
29842 };
29843 let mut __struct = Self::default();
29844 __struct.lat = buf.get_i32_le();
29845 __struct.lon = buf.get_i32_le();
29846 __struct.terrain_height = buf.get_f32_le();
29847 __struct.current_height = buf.get_f32_le();
29848 __struct.spacing = buf.get_u16_le();
29849 __struct.pending = buf.get_u16_le();
29850 __struct.loaded = buf.get_u16_le();
29851 Ok(__struct)
29852 }
29853 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29854 let mut __tmp = BytesMut::new(bytes);
29855 #[allow(clippy::absurd_extreme_comparisons)]
29856 #[allow(unused_comparisons)]
29857 if __tmp.remaining() < Self::ENCODED_LEN {
29858 panic!(
29859 "buffer is too small (need {} bytes, but got {})",
29860 Self::ENCODED_LEN,
29861 __tmp.remaining(),
29862 )
29863 }
29864 __tmp.put_i32_le(self.lat);
29865 __tmp.put_i32_le(self.lon);
29866 __tmp.put_f32_le(self.terrain_height);
29867 __tmp.put_f32_le(self.current_height);
29868 __tmp.put_u16_le(self.spacing);
29869 __tmp.put_u16_le(self.pending);
29870 __tmp.put_u16_le(self.loaded);
29871 if matches!(version, MavlinkVersion::V2) {
29872 let len = __tmp.len();
29873 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29874 } else {
29875 __tmp.len()
29876 }
29877 }
29878}
29879#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29880#[doc = ""]
29881#[doc = "ID: 133"]
29882#[derive(Debug, Clone, PartialEq)]
29883#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29884#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29885#[cfg_attr(feature = "ts", derive(TS))]
29886#[cfg_attr(feature = "ts", ts(export))]
29887pub struct TERRAIN_REQUEST_DATA {
29888 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
29889 pub mask: u64,
29890 #[doc = "Latitude of SW corner of first grid"]
29891 pub lat: i32,
29892 #[doc = "Longitude of SW corner of first grid"]
29893 pub lon: i32,
29894 #[doc = "Grid spacing"]
29895 pub grid_spacing: u16,
29896}
29897impl TERRAIN_REQUEST_DATA {
29898 pub const ENCODED_LEN: usize = 18usize;
29899 pub const DEFAULT: Self = Self {
29900 mask: 0_u64,
29901 lat: 0_i32,
29902 lon: 0_i32,
29903 grid_spacing: 0_u16,
29904 };
29905 #[cfg(feature = "arbitrary")]
29906 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29907 use arbitrary::{Arbitrary, Unstructured};
29908 let mut buf = [0u8; 1024];
29909 rng.fill_bytes(&mut buf);
29910 let mut unstructured = Unstructured::new(&buf);
29911 Self::arbitrary(&mut unstructured).unwrap_or_default()
29912 }
29913}
29914impl Default for TERRAIN_REQUEST_DATA {
29915 fn default() -> Self {
29916 Self::DEFAULT.clone()
29917 }
29918}
29919impl MessageData for TERRAIN_REQUEST_DATA {
29920 type Message = MavMessage;
29921 const ID: u32 = 133u32;
29922 const NAME: &'static str = "TERRAIN_REQUEST";
29923 const EXTRA_CRC: u8 = 6u8;
29924 const ENCODED_LEN: usize = 18usize;
29925 fn deser(
29926 _version: MavlinkVersion,
29927 __input: &[u8],
29928 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29929 let avail_len = __input.len();
29930 let mut payload_buf = [0; Self::ENCODED_LEN];
29931 let mut buf = if avail_len < Self::ENCODED_LEN {
29932 payload_buf[0..avail_len].copy_from_slice(__input);
29933 Bytes::new(&payload_buf)
29934 } else {
29935 Bytes::new(__input)
29936 };
29937 let mut __struct = Self::default();
29938 __struct.mask = buf.get_u64_le();
29939 __struct.lat = buf.get_i32_le();
29940 __struct.lon = buf.get_i32_le();
29941 __struct.grid_spacing = buf.get_u16_le();
29942 Ok(__struct)
29943 }
29944 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29945 let mut __tmp = BytesMut::new(bytes);
29946 #[allow(clippy::absurd_extreme_comparisons)]
29947 #[allow(unused_comparisons)]
29948 if __tmp.remaining() < Self::ENCODED_LEN {
29949 panic!(
29950 "buffer is too small (need {} bytes, but got {})",
29951 Self::ENCODED_LEN,
29952 __tmp.remaining(),
29953 )
29954 }
29955 __tmp.put_u64_le(self.mask);
29956 __tmp.put_i32_le(self.lat);
29957 __tmp.put_i32_le(self.lon);
29958 __tmp.put_u16_le(self.grid_spacing);
29959 if matches!(version, MavlinkVersion::V2) {
29960 let len = __tmp.len();
29961 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29962 } else {
29963 __tmp.len()
29964 }
29965 }
29966}
29967#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
29968#[doc = ""]
29969#[doc = "ID: 111"]
29970#[derive(Debug, Clone, PartialEq)]
29971#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29973#[cfg_attr(feature = "ts", derive(TS))]
29974#[cfg_attr(feature = "ts", ts(export))]
29975pub struct TIMESYNC_DATA {
29976 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
29977 pub tc1: i64,
29978 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
29979 pub ts1: i64,
29980 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
29981 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29982 pub target_system: u8,
29983 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
29984 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29985 pub target_component: u8,
29986}
29987impl TIMESYNC_DATA {
29988 pub const ENCODED_LEN: usize = 18usize;
29989 pub const DEFAULT: Self = Self {
29990 tc1: 0_i64,
29991 ts1: 0_i64,
29992 target_system: 0_u8,
29993 target_component: 0_u8,
29994 };
29995 #[cfg(feature = "arbitrary")]
29996 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29997 use arbitrary::{Arbitrary, Unstructured};
29998 let mut buf = [0u8; 1024];
29999 rng.fill_bytes(&mut buf);
30000 let mut unstructured = Unstructured::new(&buf);
30001 Self::arbitrary(&mut unstructured).unwrap_or_default()
30002 }
30003}
30004impl Default for TIMESYNC_DATA {
30005 fn default() -> Self {
30006 Self::DEFAULT.clone()
30007 }
30008}
30009impl MessageData for TIMESYNC_DATA {
30010 type Message = MavMessage;
30011 const ID: u32 = 111u32;
30012 const NAME: &'static str = "TIMESYNC";
30013 const EXTRA_CRC: u8 = 34u8;
30014 const ENCODED_LEN: usize = 18usize;
30015 fn deser(
30016 _version: MavlinkVersion,
30017 __input: &[u8],
30018 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30019 let avail_len = __input.len();
30020 let mut payload_buf = [0; Self::ENCODED_LEN];
30021 let mut buf = if avail_len < Self::ENCODED_LEN {
30022 payload_buf[0..avail_len].copy_from_slice(__input);
30023 Bytes::new(&payload_buf)
30024 } else {
30025 Bytes::new(__input)
30026 };
30027 let mut __struct = Self::default();
30028 __struct.tc1 = buf.get_i64_le();
30029 __struct.ts1 = buf.get_i64_le();
30030 __struct.target_system = buf.get_u8();
30031 __struct.target_component = buf.get_u8();
30032 Ok(__struct)
30033 }
30034 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30035 let mut __tmp = BytesMut::new(bytes);
30036 #[allow(clippy::absurd_extreme_comparisons)]
30037 #[allow(unused_comparisons)]
30038 if __tmp.remaining() < Self::ENCODED_LEN {
30039 panic!(
30040 "buffer is too small (need {} bytes, but got {})",
30041 Self::ENCODED_LEN,
30042 __tmp.remaining(),
30043 )
30044 }
30045 __tmp.put_i64_le(self.tc1);
30046 __tmp.put_i64_le(self.ts1);
30047 if matches!(version, MavlinkVersion::V2) {
30048 __tmp.put_u8(self.target_system);
30049 __tmp.put_u8(self.target_component);
30050 let len = __tmp.len();
30051 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30052 } else {
30053 __tmp.len()
30054 }
30055 }
30056}
30057#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
30058#[doc = ""]
30059#[doc = "ID: 380"]
30060#[derive(Debug, Clone, PartialEq)]
30061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30062#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30063#[cfg_attr(feature = "ts", derive(TS))]
30064#[cfg_attr(feature = "ts", ts(export))]
30065pub struct TIME_ESTIMATE_TO_TARGET_DATA {
30066 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
30067 pub safe_return: i32,
30068 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
30069 pub land: i32,
30070 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
30071 pub mission_next_item: i32,
30072 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
30073 pub mission_end: i32,
30074 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
30075 pub commanded_action: i32,
30076}
30077impl TIME_ESTIMATE_TO_TARGET_DATA {
30078 pub const ENCODED_LEN: usize = 20usize;
30079 pub const DEFAULT: Self = Self {
30080 safe_return: 0_i32,
30081 land: 0_i32,
30082 mission_next_item: 0_i32,
30083 mission_end: 0_i32,
30084 commanded_action: 0_i32,
30085 };
30086 #[cfg(feature = "arbitrary")]
30087 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30088 use arbitrary::{Arbitrary, Unstructured};
30089 let mut buf = [0u8; 1024];
30090 rng.fill_bytes(&mut buf);
30091 let mut unstructured = Unstructured::new(&buf);
30092 Self::arbitrary(&mut unstructured).unwrap_or_default()
30093 }
30094}
30095impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
30096 fn default() -> Self {
30097 Self::DEFAULT.clone()
30098 }
30099}
30100impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
30101 type Message = MavMessage;
30102 const ID: u32 = 380u32;
30103 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
30104 const EXTRA_CRC: u8 = 232u8;
30105 const ENCODED_LEN: usize = 20usize;
30106 fn deser(
30107 _version: MavlinkVersion,
30108 __input: &[u8],
30109 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30110 let avail_len = __input.len();
30111 let mut payload_buf = [0; Self::ENCODED_LEN];
30112 let mut buf = if avail_len < Self::ENCODED_LEN {
30113 payload_buf[0..avail_len].copy_from_slice(__input);
30114 Bytes::new(&payload_buf)
30115 } else {
30116 Bytes::new(__input)
30117 };
30118 let mut __struct = Self::default();
30119 __struct.safe_return = buf.get_i32_le();
30120 __struct.land = buf.get_i32_le();
30121 __struct.mission_next_item = buf.get_i32_le();
30122 __struct.mission_end = buf.get_i32_le();
30123 __struct.commanded_action = buf.get_i32_le();
30124 Ok(__struct)
30125 }
30126 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30127 let mut __tmp = BytesMut::new(bytes);
30128 #[allow(clippy::absurd_extreme_comparisons)]
30129 #[allow(unused_comparisons)]
30130 if __tmp.remaining() < Self::ENCODED_LEN {
30131 panic!(
30132 "buffer is too small (need {} bytes, but got {})",
30133 Self::ENCODED_LEN,
30134 __tmp.remaining(),
30135 )
30136 }
30137 __tmp.put_i32_le(self.safe_return);
30138 __tmp.put_i32_le(self.land);
30139 __tmp.put_i32_le(self.mission_next_item);
30140 __tmp.put_i32_le(self.mission_end);
30141 __tmp.put_i32_le(self.commanded_action);
30142 if matches!(version, MavlinkVersion::V2) {
30143 let len = __tmp.len();
30144 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30145 } else {
30146 __tmp.len()
30147 }
30148 }
30149}
30150#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
30151#[doc = ""]
30152#[doc = "ID: 333"]
30153#[derive(Debug, Clone, PartialEq)]
30154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30155#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30156#[cfg_attr(feature = "ts", derive(TS))]
30157#[cfg_attr(feature = "ts", ts(export))]
30158pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30159 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30160 pub time_usec: u64,
30161 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
30162 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30163 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30164 pub pos_x: [f32; 5],
30165 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
30166 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30167 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30168 pub pos_y: [f32; 5],
30169 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
30170 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30171 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30172 pub pos_z: [f32; 5],
30173 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
30174 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30175 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30176 pub delta: [f32; 5],
30177 #[doc = "Yaw. Set to NaN for unchanged"]
30178 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30179 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30180 pub pos_yaw: [f32; 5],
30181 #[doc = "Number of valid control points (up-to 5 points are possible)"]
30182 pub valid_points: u8,
30183}
30184impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30185 pub const ENCODED_LEN: usize = 109usize;
30186 pub const DEFAULT: Self = Self {
30187 time_usec: 0_u64,
30188 pos_x: [0.0_f32; 5usize],
30189 pos_y: [0.0_f32; 5usize],
30190 pos_z: [0.0_f32; 5usize],
30191 delta: [0.0_f32; 5usize],
30192 pos_yaw: [0.0_f32; 5usize],
30193 valid_points: 0_u8,
30194 };
30195 #[cfg(feature = "arbitrary")]
30196 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30197 use arbitrary::{Arbitrary, Unstructured};
30198 let mut buf = [0u8; 1024];
30199 rng.fill_bytes(&mut buf);
30200 let mut unstructured = Unstructured::new(&buf);
30201 Self::arbitrary(&mut unstructured).unwrap_or_default()
30202 }
30203}
30204impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30205 fn default() -> Self {
30206 Self::DEFAULT.clone()
30207 }
30208}
30209impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30210 type Message = MavMessage;
30211 const ID: u32 = 333u32;
30212 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
30213 const EXTRA_CRC: u8 = 231u8;
30214 const ENCODED_LEN: usize = 109usize;
30215 fn deser(
30216 _version: MavlinkVersion,
30217 __input: &[u8],
30218 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30219 let avail_len = __input.len();
30220 let mut payload_buf = [0; Self::ENCODED_LEN];
30221 let mut buf = if avail_len < Self::ENCODED_LEN {
30222 payload_buf[0..avail_len].copy_from_slice(__input);
30223 Bytes::new(&payload_buf)
30224 } else {
30225 Bytes::new(__input)
30226 };
30227 let mut __struct = Self::default();
30228 __struct.time_usec = buf.get_u64_le();
30229 for v in &mut __struct.pos_x {
30230 let val = buf.get_f32_le();
30231 *v = val;
30232 }
30233 for v in &mut __struct.pos_y {
30234 let val = buf.get_f32_le();
30235 *v = val;
30236 }
30237 for v in &mut __struct.pos_z {
30238 let val = buf.get_f32_le();
30239 *v = val;
30240 }
30241 for v in &mut __struct.delta {
30242 let val = buf.get_f32_le();
30243 *v = val;
30244 }
30245 for v in &mut __struct.pos_yaw {
30246 let val = buf.get_f32_le();
30247 *v = val;
30248 }
30249 __struct.valid_points = buf.get_u8();
30250 Ok(__struct)
30251 }
30252 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30253 let mut __tmp = BytesMut::new(bytes);
30254 #[allow(clippy::absurd_extreme_comparisons)]
30255 #[allow(unused_comparisons)]
30256 if __tmp.remaining() < Self::ENCODED_LEN {
30257 panic!(
30258 "buffer is too small (need {} bytes, but got {})",
30259 Self::ENCODED_LEN,
30260 __tmp.remaining(),
30261 )
30262 }
30263 __tmp.put_u64_le(self.time_usec);
30264 for val in &self.pos_x {
30265 __tmp.put_f32_le(*val);
30266 }
30267 for val in &self.pos_y {
30268 __tmp.put_f32_le(*val);
30269 }
30270 for val in &self.pos_z {
30271 __tmp.put_f32_le(*val);
30272 }
30273 for val in &self.delta {
30274 __tmp.put_f32_le(*val);
30275 }
30276 for val in &self.pos_yaw {
30277 __tmp.put_f32_le(*val);
30278 }
30279 __tmp.put_u8(self.valid_points);
30280 if matches!(version, MavlinkVersion::V2) {
30281 let len = __tmp.len();
30282 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30283 } else {
30284 __tmp.len()
30285 }
30286 }
30287}
30288#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
30289#[doc = ""]
30290#[doc = "ID: 332"]
30291#[derive(Debug, Clone, PartialEq)]
30292#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30293#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30294#[cfg_attr(feature = "ts", derive(TS))]
30295#[cfg_attr(feature = "ts", ts(export))]
30296pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30297 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30298 pub time_usec: u64,
30299 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
30300 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30301 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30302 pub pos_x: [f32; 5],
30303 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
30304 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30305 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30306 pub pos_y: [f32; 5],
30307 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
30308 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30309 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30310 pub pos_z: [f32; 5],
30311 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
30312 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30313 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30314 pub vel_x: [f32; 5],
30315 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
30316 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30317 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30318 pub vel_y: [f32; 5],
30319 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
30320 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30321 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30322 pub vel_z: [f32; 5],
30323 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
30324 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30325 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30326 pub acc_x: [f32; 5],
30327 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
30328 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30329 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30330 pub acc_y: [f32; 5],
30331 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
30332 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30333 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30334 pub acc_z: [f32; 5],
30335 #[doc = "Yaw angle, set to NaN if not being used"]
30336 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30337 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30338 pub pos_yaw: [f32; 5],
30339 #[doc = "Yaw rate, set to NaN if not being used"]
30340 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30341 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30342 pub vel_yaw: [f32; 5],
30343 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
30344 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30345 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30346 pub command: [u16; 5],
30347 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
30348 pub valid_points: u8,
30349}
30350impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30351 pub const ENCODED_LEN: usize = 239usize;
30352 pub const DEFAULT: Self = Self {
30353 time_usec: 0_u64,
30354 pos_x: [0.0_f32; 5usize],
30355 pos_y: [0.0_f32; 5usize],
30356 pos_z: [0.0_f32; 5usize],
30357 vel_x: [0.0_f32; 5usize],
30358 vel_y: [0.0_f32; 5usize],
30359 vel_z: [0.0_f32; 5usize],
30360 acc_x: [0.0_f32; 5usize],
30361 acc_y: [0.0_f32; 5usize],
30362 acc_z: [0.0_f32; 5usize],
30363 pos_yaw: [0.0_f32; 5usize],
30364 vel_yaw: [0.0_f32; 5usize],
30365 command: [0_u16; 5usize],
30366 valid_points: 0_u8,
30367 };
30368 #[cfg(feature = "arbitrary")]
30369 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30370 use arbitrary::{Arbitrary, Unstructured};
30371 let mut buf = [0u8; 1024];
30372 rng.fill_bytes(&mut buf);
30373 let mut unstructured = Unstructured::new(&buf);
30374 Self::arbitrary(&mut unstructured).unwrap_or_default()
30375 }
30376}
30377impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30378 fn default() -> Self {
30379 Self::DEFAULT.clone()
30380 }
30381}
30382impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30383 type Message = MavMessage;
30384 const ID: u32 = 332u32;
30385 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
30386 const EXTRA_CRC: u8 = 236u8;
30387 const ENCODED_LEN: usize = 239usize;
30388 fn deser(
30389 _version: MavlinkVersion,
30390 __input: &[u8],
30391 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30392 let avail_len = __input.len();
30393 let mut payload_buf = [0; Self::ENCODED_LEN];
30394 let mut buf = if avail_len < Self::ENCODED_LEN {
30395 payload_buf[0..avail_len].copy_from_slice(__input);
30396 Bytes::new(&payload_buf)
30397 } else {
30398 Bytes::new(__input)
30399 };
30400 let mut __struct = Self::default();
30401 __struct.time_usec = buf.get_u64_le();
30402 for v in &mut __struct.pos_x {
30403 let val = buf.get_f32_le();
30404 *v = val;
30405 }
30406 for v in &mut __struct.pos_y {
30407 let val = buf.get_f32_le();
30408 *v = val;
30409 }
30410 for v in &mut __struct.pos_z {
30411 let val = buf.get_f32_le();
30412 *v = val;
30413 }
30414 for v in &mut __struct.vel_x {
30415 let val = buf.get_f32_le();
30416 *v = val;
30417 }
30418 for v in &mut __struct.vel_y {
30419 let val = buf.get_f32_le();
30420 *v = val;
30421 }
30422 for v in &mut __struct.vel_z {
30423 let val = buf.get_f32_le();
30424 *v = val;
30425 }
30426 for v in &mut __struct.acc_x {
30427 let val = buf.get_f32_le();
30428 *v = val;
30429 }
30430 for v in &mut __struct.acc_y {
30431 let val = buf.get_f32_le();
30432 *v = val;
30433 }
30434 for v in &mut __struct.acc_z {
30435 let val = buf.get_f32_le();
30436 *v = val;
30437 }
30438 for v in &mut __struct.pos_yaw {
30439 let val = buf.get_f32_le();
30440 *v = val;
30441 }
30442 for v in &mut __struct.vel_yaw {
30443 let val = buf.get_f32_le();
30444 *v = val;
30445 }
30446 for v in &mut __struct.command {
30447 let val = buf.get_u16_le();
30448 *v = val;
30449 }
30450 __struct.valid_points = buf.get_u8();
30451 Ok(__struct)
30452 }
30453 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30454 let mut __tmp = BytesMut::new(bytes);
30455 #[allow(clippy::absurd_extreme_comparisons)]
30456 #[allow(unused_comparisons)]
30457 if __tmp.remaining() < Self::ENCODED_LEN {
30458 panic!(
30459 "buffer is too small (need {} bytes, but got {})",
30460 Self::ENCODED_LEN,
30461 __tmp.remaining(),
30462 )
30463 }
30464 __tmp.put_u64_le(self.time_usec);
30465 for val in &self.pos_x {
30466 __tmp.put_f32_le(*val);
30467 }
30468 for val in &self.pos_y {
30469 __tmp.put_f32_le(*val);
30470 }
30471 for val in &self.pos_z {
30472 __tmp.put_f32_le(*val);
30473 }
30474 for val in &self.vel_x {
30475 __tmp.put_f32_le(*val);
30476 }
30477 for val in &self.vel_y {
30478 __tmp.put_f32_le(*val);
30479 }
30480 for val in &self.vel_z {
30481 __tmp.put_f32_le(*val);
30482 }
30483 for val in &self.acc_x {
30484 __tmp.put_f32_le(*val);
30485 }
30486 for val in &self.acc_y {
30487 __tmp.put_f32_le(*val);
30488 }
30489 for val in &self.acc_z {
30490 __tmp.put_f32_le(*val);
30491 }
30492 for val in &self.pos_yaw {
30493 __tmp.put_f32_le(*val);
30494 }
30495 for val in &self.vel_yaw {
30496 __tmp.put_f32_le(*val);
30497 }
30498 for val in &self.command {
30499 __tmp.put_u16_le(*val);
30500 }
30501 __tmp.put_u8(self.valid_points);
30502 if matches!(version, MavlinkVersion::V2) {
30503 let len = __tmp.len();
30504 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30505 } else {
30506 __tmp.len()
30507 }
30508 }
30509}
30510#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
30511#[doc = ""]
30512#[doc = "ID: 385"]
30513#[derive(Debug, Clone, PartialEq)]
30514#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30515#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30516#[cfg_attr(feature = "ts", derive(TS))]
30517#[cfg_attr(feature = "ts", ts(export))]
30518pub struct TUNNEL_DATA {
30519 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30520 pub payload_type: MavTunnelPayloadType,
30521 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
30522 pub target_system: u8,
30523 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
30524 pub target_component: u8,
30525 #[doc = "Length of the data transported in payload"]
30526 pub payload_length: u8,
30527 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
30528 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30529 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30530 pub payload: [u8; 128],
30531}
30532impl TUNNEL_DATA {
30533 pub const ENCODED_LEN: usize = 133usize;
30534 pub const DEFAULT: Self = Self {
30535 payload_type: MavTunnelPayloadType::DEFAULT,
30536 target_system: 0_u8,
30537 target_component: 0_u8,
30538 payload_length: 0_u8,
30539 payload: [0_u8; 128usize],
30540 };
30541 #[cfg(feature = "arbitrary")]
30542 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30543 use arbitrary::{Arbitrary, Unstructured};
30544 let mut buf = [0u8; 1024];
30545 rng.fill_bytes(&mut buf);
30546 let mut unstructured = Unstructured::new(&buf);
30547 Self::arbitrary(&mut unstructured).unwrap_or_default()
30548 }
30549}
30550impl Default for TUNNEL_DATA {
30551 fn default() -> Self {
30552 Self::DEFAULT.clone()
30553 }
30554}
30555impl MessageData for TUNNEL_DATA {
30556 type Message = MavMessage;
30557 const ID: u32 = 385u32;
30558 const NAME: &'static str = "TUNNEL";
30559 const EXTRA_CRC: u8 = 147u8;
30560 const ENCODED_LEN: usize = 133usize;
30561 fn deser(
30562 _version: MavlinkVersion,
30563 __input: &[u8],
30564 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30565 let avail_len = __input.len();
30566 let mut payload_buf = [0; Self::ENCODED_LEN];
30567 let mut buf = if avail_len < Self::ENCODED_LEN {
30568 payload_buf[0..avail_len].copy_from_slice(__input);
30569 Bytes::new(&payload_buf)
30570 } else {
30571 Bytes::new(__input)
30572 };
30573 let mut __struct = Self::default();
30574 let tmp = buf.get_u16_le();
30575 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
30576 ::mavlink_core::error::ParserError::InvalidEnum {
30577 enum_type: "MavTunnelPayloadType",
30578 value: tmp as u64,
30579 },
30580 )?;
30581 __struct.target_system = buf.get_u8();
30582 __struct.target_component = buf.get_u8();
30583 __struct.payload_length = buf.get_u8();
30584 for v in &mut __struct.payload {
30585 let val = buf.get_u8();
30586 *v = val;
30587 }
30588 Ok(__struct)
30589 }
30590 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30591 let mut __tmp = BytesMut::new(bytes);
30592 #[allow(clippy::absurd_extreme_comparisons)]
30593 #[allow(unused_comparisons)]
30594 if __tmp.remaining() < Self::ENCODED_LEN {
30595 panic!(
30596 "buffer is too small (need {} bytes, but got {})",
30597 Self::ENCODED_LEN,
30598 __tmp.remaining(),
30599 )
30600 }
30601 __tmp.put_u16_le(self.payload_type as u16);
30602 __tmp.put_u8(self.target_system);
30603 __tmp.put_u8(self.target_component);
30604 __tmp.put_u8(self.payload_length);
30605 for val in &self.payload {
30606 __tmp.put_u8(*val);
30607 }
30608 if matches!(version, MavlinkVersion::V2) {
30609 let len = __tmp.len();
30610 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30611 } else {
30612 __tmp.len()
30613 }
30614 }
30615}
30616#[doc = "System status specific to ualberta uav."]
30617#[doc = ""]
30618#[doc = "ID: 222"]
30619#[derive(Debug, Clone, PartialEq)]
30620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30622#[cfg_attr(feature = "ts", derive(TS))]
30623#[cfg_attr(feature = "ts", ts(export))]
30624pub struct UALBERTA_SYS_STATUS_DATA {
30625 #[doc = "System mode, see UALBERTA_AUTOPILOT_MODE ENUM"]
30626 pub mode: u8,
30627 #[doc = "Navigation mode, see UALBERTA_NAV_MODE ENUM"]
30628 pub nav_mode: u8,
30629 #[doc = "Pilot mode, see UALBERTA_PILOT_MODE"]
30630 pub pilot: u8,
30631}
30632impl UALBERTA_SYS_STATUS_DATA {
30633 pub const ENCODED_LEN: usize = 3usize;
30634 pub const DEFAULT: Self = Self {
30635 mode: 0_u8,
30636 nav_mode: 0_u8,
30637 pilot: 0_u8,
30638 };
30639 #[cfg(feature = "arbitrary")]
30640 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30641 use arbitrary::{Arbitrary, Unstructured};
30642 let mut buf = [0u8; 1024];
30643 rng.fill_bytes(&mut buf);
30644 let mut unstructured = Unstructured::new(&buf);
30645 Self::arbitrary(&mut unstructured).unwrap_or_default()
30646 }
30647}
30648impl Default for UALBERTA_SYS_STATUS_DATA {
30649 fn default() -> Self {
30650 Self::DEFAULT.clone()
30651 }
30652}
30653impl MessageData for UALBERTA_SYS_STATUS_DATA {
30654 type Message = MavMessage;
30655 const ID: u32 = 222u32;
30656 const NAME: &'static str = "UALBERTA_SYS_STATUS";
30657 const EXTRA_CRC: u8 = 15u8;
30658 const ENCODED_LEN: usize = 3usize;
30659 fn deser(
30660 _version: MavlinkVersion,
30661 __input: &[u8],
30662 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30663 let avail_len = __input.len();
30664 let mut payload_buf = [0; Self::ENCODED_LEN];
30665 let mut buf = if avail_len < Self::ENCODED_LEN {
30666 payload_buf[0..avail_len].copy_from_slice(__input);
30667 Bytes::new(&payload_buf)
30668 } else {
30669 Bytes::new(__input)
30670 };
30671 let mut __struct = Self::default();
30672 __struct.mode = buf.get_u8();
30673 __struct.nav_mode = buf.get_u8();
30674 __struct.pilot = buf.get_u8();
30675 Ok(__struct)
30676 }
30677 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30678 let mut __tmp = BytesMut::new(bytes);
30679 #[allow(clippy::absurd_extreme_comparisons)]
30680 #[allow(unused_comparisons)]
30681 if __tmp.remaining() < Self::ENCODED_LEN {
30682 panic!(
30683 "buffer is too small (need {} bytes, but got {})",
30684 Self::ENCODED_LEN,
30685 __tmp.remaining(),
30686 )
30687 }
30688 __tmp.put_u8(self.mode);
30689 __tmp.put_u8(self.nav_mode);
30690 __tmp.put_u8(self.pilot);
30691 if matches!(version, MavlinkVersion::V2) {
30692 let len = __tmp.len();
30693 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30694 } else {
30695 __tmp.len()
30696 }
30697 }
30698}
30699#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
30700#[doc = ""]
30701#[doc = "ID: 311"]
30702#[derive(Debug, Clone, PartialEq)]
30703#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30704#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30705#[cfg_attr(feature = "ts", derive(TS))]
30706#[cfg_attr(feature = "ts", ts(export))]
30707pub struct UAVCAN_NODE_INFO_DATA {
30708 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30709 pub time_usec: u64,
30710 #[doc = "Time since the start-up of the node."]
30711 pub uptime_sec: u32,
30712 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
30713 pub sw_vcs_commit: u32,
30714 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
30715 #[cfg_attr(feature = "ts", ts(type = "string"))]
30716 pub name: CharArray<80>,
30717 #[doc = "Hardware major version number."]
30718 pub hw_version_major: u8,
30719 #[doc = "Hardware minor version number."]
30720 pub hw_version_minor: u8,
30721 #[doc = "Hardware unique 128-bit ID."]
30722 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30723 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30724 pub hw_unique_id: [u8; 16],
30725 #[doc = "Software major version number."]
30726 pub sw_version_major: u8,
30727 #[doc = "Software minor version number."]
30728 pub sw_version_minor: u8,
30729}
30730impl UAVCAN_NODE_INFO_DATA {
30731 pub const ENCODED_LEN: usize = 116usize;
30732 pub const DEFAULT: Self = Self {
30733 time_usec: 0_u64,
30734 uptime_sec: 0_u32,
30735 sw_vcs_commit: 0_u32,
30736 name: CharArray::new([0_u8; 80usize]),
30737 hw_version_major: 0_u8,
30738 hw_version_minor: 0_u8,
30739 hw_unique_id: [0_u8; 16usize],
30740 sw_version_major: 0_u8,
30741 sw_version_minor: 0_u8,
30742 };
30743 #[cfg(feature = "arbitrary")]
30744 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30745 use arbitrary::{Arbitrary, Unstructured};
30746 let mut buf = [0u8; 1024];
30747 rng.fill_bytes(&mut buf);
30748 let mut unstructured = Unstructured::new(&buf);
30749 Self::arbitrary(&mut unstructured).unwrap_or_default()
30750 }
30751}
30752impl Default for UAVCAN_NODE_INFO_DATA {
30753 fn default() -> Self {
30754 Self::DEFAULT.clone()
30755 }
30756}
30757impl MessageData for UAVCAN_NODE_INFO_DATA {
30758 type Message = MavMessage;
30759 const ID: u32 = 311u32;
30760 const NAME: &'static str = "UAVCAN_NODE_INFO";
30761 const EXTRA_CRC: u8 = 95u8;
30762 const ENCODED_LEN: usize = 116usize;
30763 fn deser(
30764 _version: MavlinkVersion,
30765 __input: &[u8],
30766 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30767 let avail_len = __input.len();
30768 let mut payload_buf = [0; Self::ENCODED_LEN];
30769 let mut buf = if avail_len < Self::ENCODED_LEN {
30770 payload_buf[0..avail_len].copy_from_slice(__input);
30771 Bytes::new(&payload_buf)
30772 } else {
30773 Bytes::new(__input)
30774 };
30775 let mut __struct = Self::default();
30776 __struct.time_usec = buf.get_u64_le();
30777 __struct.uptime_sec = buf.get_u32_le();
30778 __struct.sw_vcs_commit = buf.get_u32_le();
30779 let mut tmp = [0_u8; 80usize];
30780 for v in &mut tmp {
30781 *v = buf.get_u8();
30782 }
30783 __struct.name = CharArray::new(tmp);
30784 __struct.hw_version_major = buf.get_u8();
30785 __struct.hw_version_minor = buf.get_u8();
30786 for v in &mut __struct.hw_unique_id {
30787 let val = buf.get_u8();
30788 *v = val;
30789 }
30790 __struct.sw_version_major = buf.get_u8();
30791 __struct.sw_version_minor = buf.get_u8();
30792 Ok(__struct)
30793 }
30794 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30795 let mut __tmp = BytesMut::new(bytes);
30796 #[allow(clippy::absurd_extreme_comparisons)]
30797 #[allow(unused_comparisons)]
30798 if __tmp.remaining() < Self::ENCODED_LEN {
30799 panic!(
30800 "buffer is too small (need {} bytes, but got {})",
30801 Self::ENCODED_LEN,
30802 __tmp.remaining(),
30803 )
30804 }
30805 __tmp.put_u64_le(self.time_usec);
30806 __tmp.put_u32_le(self.uptime_sec);
30807 __tmp.put_u32_le(self.sw_vcs_commit);
30808 for val in &self.name {
30809 __tmp.put_u8(*val);
30810 }
30811 __tmp.put_u8(self.hw_version_major);
30812 __tmp.put_u8(self.hw_version_minor);
30813 for val in &self.hw_unique_id {
30814 __tmp.put_u8(*val);
30815 }
30816 __tmp.put_u8(self.sw_version_major);
30817 __tmp.put_u8(self.sw_version_minor);
30818 if matches!(version, MavlinkVersion::V2) {
30819 let len = __tmp.len();
30820 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30821 } else {
30822 __tmp.len()
30823 }
30824 }
30825}
30826#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
30827#[doc = ""]
30828#[doc = "ID: 310"]
30829#[derive(Debug, Clone, PartialEq)]
30830#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30831#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30832#[cfg_attr(feature = "ts", derive(TS))]
30833#[cfg_attr(feature = "ts", ts(export))]
30834pub struct UAVCAN_NODE_STATUS_DATA {
30835 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30836 pub time_usec: u64,
30837 #[doc = "Time since the start-up of the node."]
30838 pub uptime_sec: u32,
30839 #[doc = "Vendor-specific status information."]
30840 pub vendor_specific_status_code: u16,
30841 #[doc = "Generalized node health status."]
30842 pub health: UavcanNodeHealth,
30843 #[doc = "Generalized operating mode."]
30844 pub mode: UavcanNodeMode,
30845 #[doc = "Not used currently."]
30846 pub sub_mode: u8,
30847}
30848impl UAVCAN_NODE_STATUS_DATA {
30849 pub const ENCODED_LEN: usize = 17usize;
30850 pub const DEFAULT: Self = Self {
30851 time_usec: 0_u64,
30852 uptime_sec: 0_u32,
30853 vendor_specific_status_code: 0_u16,
30854 health: UavcanNodeHealth::DEFAULT,
30855 mode: UavcanNodeMode::DEFAULT,
30856 sub_mode: 0_u8,
30857 };
30858 #[cfg(feature = "arbitrary")]
30859 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30860 use arbitrary::{Arbitrary, Unstructured};
30861 let mut buf = [0u8; 1024];
30862 rng.fill_bytes(&mut buf);
30863 let mut unstructured = Unstructured::new(&buf);
30864 Self::arbitrary(&mut unstructured).unwrap_or_default()
30865 }
30866}
30867impl Default for UAVCAN_NODE_STATUS_DATA {
30868 fn default() -> Self {
30869 Self::DEFAULT.clone()
30870 }
30871}
30872impl MessageData for UAVCAN_NODE_STATUS_DATA {
30873 type Message = MavMessage;
30874 const ID: u32 = 310u32;
30875 const NAME: &'static str = "UAVCAN_NODE_STATUS";
30876 const EXTRA_CRC: u8 = 28u8;
30877 const ENCODED_LEN: usize = 17usize;
30878 fn deser(
30879 _version: MavlinkVersion,
30880 __input: &[u8],
30881 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30882 let avail_len = __input.len();
30883 let mut payload_buf = [0; Self::ENCODED_LEN];
30884 let mut buf = if avail_len < Self::ENCODED_LEN {
30885 payload_buf[0..avail_len].copy_from_slice(__input);
30886 Bytes::new(&payload_buf)
30887 } else {
30888 Bytes::new(__input)
30889 };
30890 let mut __struct = Self::default();
30891 __struct.time_usec = buf.get_u64_le();
30892 __struct.uptime_sec = buf.get_u32_le();
30893 __struct.vendor_specific_status_code = buf.get_u16_le();
30894 let tmp = buf.get_u8();
30895 __struct.health =
30896 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30897 enum_type: "UavcanNodeHealth",
30898 value: tmp as u64,
30899 })?;
30900 let tmp = buf.get_u8();
30901 __struct.mode =
30902 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30903 enum_type: "UavcanNodeMode",
30904 value: tmp as u64,
30905 })?;
30906 __struct.sub_mode = buf.get_u8();
30907 Ok(__struct)
30908 }
30909 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30910 let mut __tmp = BytesMut::new(bytes);
30911 #[allow(clippy::absurd_extreme_comparisons)]
30912 #[allow(unused_comparisons)]
30913 if __tmp.remaining() < Self::ENCODED_LEN {
30914 panic!(
30915 "buffer is too small (need {} bytes, but got {})",
30916 Self::ENCODED_LEN,
30917 __tmp.remaining(),
30918 )
30919 }
30920 __tmp.put_u64_le(self.time_usec);
30921 __tmp.put_u32_le(self.uptime_sec);
30922 __tmp.put_u16_le(self.vendor_specific_status_code);
30923 __tmp.put_u8(self.health as u8);
30924 __tmp.put_u8(self.mode as u8);
30925 __tmp.put_u8(self.sub_mode);
30926 if matches!(version, MavlinkVersion::V2) {
30927 let len = __tmp.len();
30928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30929 } else {
30930 __tmp.len()
30931 }
30932 }
30933}
30934#[doc = "The global position resulting from GPS and sensor fusion."]
30935#[doc = ""]
30936#[doc = "ID: 340"]
30937#[derive(Debug, Clone, PartialEq)]
30938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30940#[cfg_attr(feature = "ts", derive(TS))]
30941#[cfg_attr(feature = "ts", ts(export))]
30942pub struct UTM_GLOBAL_POSITION_DATA {
30943 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
30944 pub time: u64,
30945 #[doc = "Latitude (WGS84)"]
30946 pub lat: i32,
30947 #[doc = "Longitude (WGS84)"]
30948 pub lon: i32,
30949 #[doc = "Altitude (WGS84)"]
30950 pub alt: i32,
30951 #[doc = "Altitude above ground"]
30952 pub relative_alt: i32,
30953 #[doc = "Next waypoint, latitude (WGS84)"]
30954 pub next_lat: i32,
30955 #[doc = "Next waypoint, longitude (WGS84)"]
30956 pub next_lon: i32,
30957 #[doc = "Next waypoint, altitude (WGS84)"]
30958 pub next_alt: i32,
30959 #[doc = "Ground X speed (latitude, positive north)"]
30960 pub vx: i16,
30961 #[doc = "Ground Y speed (longitude, positive east)"]
30962 pub vy: i16,
30963 #[doc = "Ground Z speed (altitude, positive down)"]
30964 pub vz: i16,
30965 #[doc = "Horizontal position uncertainty (standard deviation)"]
30966 pub h_acc: u16,
30967 #[doc = "Altitude uncertainty (standard deviation)"]
30968 pub v_acc: u16,
30969 #[doc = "Speed uncertainty (standard deviation)"]
30970 pub vel_acc: u16,
30971 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
30972 pub update_rate: u16,
30973 #[doc = "Unique UAS ID."]
30974 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30975 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30976 pub uas_id: [u8; 18],
30977 #[doc = "Flight state"]
30978 pub flight_state: UtmFlightState,
30979 #[doc = "Bitwise OR combination of the data available flags."]
30980 pub flags: UtmDataAvailFlags,
30981}
30982impl UTM_GLOBAL_POSITION_DATA {
30983 pub const ENCODED_LEN: usize = 70usize;
30984 pub const DEFAULT: Self = Self {
30985 time: 0_u64,
30986 lat: 0_i32,
30987 lon: 0_i32,
30988 alt: 0_i32,
30989 relative_alt: 0_i32,
30990 next_lat: 0_i32,
30991 next_lon: 0_i32,
30992 next_alt: 0_i32,
30993 vx: 0_i16,
30994 vy: 0_i16,
30995 vz: 0_i16,
30996 h_acc: 0_u16,
30997 v_acc: 0_u16,
30998 vel_acc: 0_u16,
30999 update_rate: 0_u16,
31000 uas_id: [0_u8; 18usize],
31001 flight_state: UtmFlightState::DEFAULT,
31002 flags: UtmDataAvailFlags::DEFAULT,
31003 };
31004 #[cfg(feature = "arbitrary")]
31005 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31006 use arbitrary::{Arbitrary, Unstructured};
31007 let mut buf = [0u8; 1024];
31008 rng.fill_bytes(&mut buf);
31009 let mut unstructured = Unstructured::new(&buf);
31010 Self::arbitrary(&mut unstructured).unwrap_or_default()
31011 }
31012}
31013impl Default for UTM_GLOBAL_POSITION_DATA {
31014 fn default() -> Self {
31015 Self::DEFAULT.clone()
31016 }
31017}
31018impl MessageData for UTM_GLOBAL_POSITION_DATA {
31019 type Message = MavMessage;
31020 const ID: u32 = 340u32;
31021 const NAME: &'static str = "UTM_GLOBAL_POSITION";
31022 const EXTRA_CRC: u8 = 99u8;
31023 const ENCODED_LEN: usize = 70usize;
31024 fn deser(
31025 _version: MavlinkVersion,
31026 __input: &[u8],
31027 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31028 let avail_len = __input.len();
31029 let mut payload_buf = [0; Self::ENCODED_LEN];
31030 let mut buf = if avail_len < Self::ENCODED_LEN {
31031 payload_buf[0..avail_len].copy_from_slice(__input);
31032 Bytes::new(&payload_buf)
31033 } else {
31034 Bytes::new(__input)
31035 };
31036 let mut __struct = Self::default();
31037 __struct.time = buf.get_u64_le();
31038 __struct.lat = buf.get_i32_le();
31039 __struct.lon = buf.get_i32_le();
31040 __struct.alt = buf.get_i32_le();
31041 __struct.relative_alt = buf.get_i32_le();
31042 __struct.next_lat = buf.get_i32_le();
31043 __struct.next_lon = buf.get_i32_le();
31044 __struct.next_alt = buf.get_i32_le();
31045 __struct.vx = buf.get_i16_le();
31046 __struct.vy = buf.get_i16_le();
31047 __struct.vz = buf.get_i16_le();
31048 __struct.h_acc = buf.get_u16_le();
31049 __struct.v_acc = buf.get_u16_le();
31050 __struct.vel_acc = buf.get_u16_le();
31051 __struct.update_rate = buf.get_u16_le();
31052 for v in &mut __struct.uas_id {
31053 let val = buf.get_u8();
31054 *v = val;
31055 }
31056 let tmp = buf.get_u8();
31057 __struct.flight_state =
31058 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31059 enum_type: "UtmFlightState",
31060 value: tmp as u64,
31061 })?;
31062 let tmp = buf.get_u8();
31063 __struct.flags = UtmDataAvailFlags::from_bits(tmp as <UtmDataAvailFlags as Flags>::Bits)
31064 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31065 flag_type: "UtmDataAvailFlags",
31066 value: tmp as u64,
31067 })?;
31068 Ok(__struct)
31069 }
31070 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31071 let mut __tmp = BytesMut::new(bytes);
31072 #[allow(clippy::absurd_extreme_comparisons)]
31073 #[allow(unused_comparisons)]
31074 if __tmp.remaining() < Self::ENCODED_LEN {
31075 panic!(
31076 "buffer is too small (need {} bytes, but got {})",
31077 Self::ENCODED_LEN,
31078 __tmp.remaining(),
31079 )
31080 }
31081 __tmp.put_u64_le(self.time);
31082 __tmp.put_i32_le(self.lat);
31083 __tmp.put_i32_le(self.lon);
31084 __tmp.put_i32_le(self.alt);
31085 __tmp.put_i32_le(self.relative_alt);
31086 __tmp.put_i32_le(self.next_lat);
31087 __tmp.put_i32_le(self.next_lon);
31088 __tmp.put_i32_le(self.next_alt);
31089 __tmp.put_i16_le(self.vx);
31090 __tmp.put_i16_le(self.vy);
31091 __tmp.put_i16_le(self.vz);
31092 __tmp.put_u16_le(self.h_acc);
31093 __tmp.put_u16_le(self.v_acc);
31094 __tmp.put_u16_le(self.vel_acc);
31095 __tmp.put_u16_le(self.update_rate);
31096 for val in &self.uas_id {
31097 __tmp.put_u8(*val);
31098 }
31099 __tmp.put_u8(self.flight_state as u8);
31100 __tmp.put_u8(self.flags.bits() as u8);
31101 if matches!(version, MavlinkVersion::V2) {
31102 let len = __tmp.len();
31103 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31104 } else {
31105 __tmp.len()
31106 }
31107 }
31108}
31109#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
31110#[doc = ""]
31111#[doc = "ID: 248"]
31112#[derive(Debug, Clone, PartialEq)]
31113#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31114#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31115#[cfg_attr(feature = "ts", derive(TS))]
31116#[cfg_attr(feature = "ts", ts(export))]
31117pub struct V2_EXTENSION_DATA {
31118 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31119 pub message_type: u16,
31120 #[doc = "Network ID (0 for broadcast)"]
31121 pub target_network: u8,
31122 #[doc = "System ID (0 for broadcast)"]
31123 pub target_system: u8,
31124 #[doc = "Component ID (0 for broadcast)"]
31125 pub target_component: u8,
31126 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
31127 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31128 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31129 pub payload: [u8; 249],
31130}
31131impl V2_EXTENSION_DATA {
31132 pub const ENCODED_LEN: usize = 254usize;
31133 pub const DEFAULT: Self = Self {
31134 message_type: 0_u16,
31135 target_network: 0_u8,
31136 target_system: 0_u8,
31137 target_component: 0_u8,
31138 payload: [0_u8; 249usize],
31139 };
31140 #[cfg(feature = "arbitrary")]
31141 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31142 use arbitrary::{Arbitrary, Unstructured};
31143 let mut buf = [0u8; 1024];
31144 rng.fill_bytes(&mut buf);
31145 let mut unstructured = Unstructured::new(&buf);
31146 Self::arbitrary(&mut unstructured).unwrap_or_default()
31147 }
31148}
31149impl Default for V2_EXTENSION_DATA {
31150 fn default() -> Self {
31151 Self::DEFAULT.clone()
31152 }
31153}
31154impl MessageData for V2_EXTENSION_DATA {
31155 type Message = MavMessage;
31156 const ID: u32 = 248u32;
31157 const NAME: &'static str = "V2_EXTENSION";
31158 const EXTRA_CRC: u8 = 8u8;
31159 const ENCODED_LEN: usize = 254usize;
31160 fn deser(
31161 _version: MavlinkVersion,
31162 __input: &[u8],
31163 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31164 let avail_len = __input.len();
31165 let mut payload_buf = [0; Self::ENCODED_LEN];
31166 let mut buf = if avail_len < Self::ENCODED_LEN {
31167 payload_buf[0..avail_len].copy_from_slice(__input);
31168 Bytes::new(&payload_buf)
31169 } else {
31170 Bytes::new(__input)
31171 };
31172 let mut __struct = Self::default();
31173 __struct.message_type = buf.get_u16_le();
31174 __struct.target_network = buf.get_u8();
31175 __struct.target_system = buf.get_u8();
31176 __struct.target_component = buf.get_u8();
31177 for v in &mut __struct.payload {
31178 let val = buf.get_u8();
31179 *v = val;
31180 }
31181 Ok(__struct)
31182 }
31183 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31184 let mut __tmp = BytesMut::new(bytes);
31185 #[allow(clippy::absurd_extreme_comparisons)]
31186 #[allow(unused_comparisons)]
31187 if __tmp.remaining() < Self::ENCODED_LEN {
31188 panic!(
31189 "buffer is too small (need {} bytes, but got {})",
31190 Self::ENCODED_LEN,
31191 __tmp.remaining(),
31192 )
31193 }
31194 __tmp.put_u16_le(self.message_type);
31195 __tmp.put_u8(self.target_network);
31196 __tmp.put_u8(self.target_system);
31197 __tmp.put_u8(self.target_component);
31198 for val in &self.payload {
31199 __tmp.put_u8(*val);
31200 }
31201 if matches!(version, MavlinkVersion::V2) {
31202 let len = __tmp.len();
31203 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31204 } else {
31205 __tmp.len()
31206 }
31207 }
31208}
31209#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
31210#[doc = ""]
31211#[doc = "ID: 74"]
31212#[derive(Debug, Clone, PartialEq)]
31213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31214#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31215#[cfg_attr(feature = "ts", derive(TS))]
31216#[cfg_attr(feature = "ts", ts(export))]
31217pub struct VFR_HUD_DATA {
31218 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
31219 pub airspeed: f32,
31220 #[doc = "Current ground speed."]
31221 pub groundspeed: f32,
31222 #[doc = "Current altitude (MSL)."]
31223 pub alt: f32,
31224 #[doc = "Current climb rate."]
31225 pub climb: f32,
31226 #[doc = "Current heading in compass units (0-360, 0=north)."]
31227 pub heading: i16,
31228 #[doc = "Current throttle setting (0 to 100)."]
31229 pub throttle: u16,
31230}
31231impl VFR_HUD_DATA {
31232 pub const ENCODED_LEN: usize = 20usize;
31233 pub const DEFAULT: Self = Self {
31234 airspeed: 0.0_f32,
31235 groundspeed: 0.0_f32,
31236 alt: 0.0_f32,
31237 climb: 0.0_f32,
31238 heading: 0_i16,
31239 throttle: 0_u16,
31240 };
31241 #[cfg(feature = "arbitrary")]
31242 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31243 use arbitrary::{Arbitrary, Unstructured};
31244 let mut buf = [0u8; 1024];
31245 rng.fill_bytes(&mut buf);
31246 let mut unstructured = Unstructured::new(&buf);
31247 Self::arbitrary(&mut unstructured).unwrap_or_default()
31248 }
31249}
31250impl Default for VFR_HUD_DATA {
31251 fn default() -> Self {
31252 Self::DEFAULT.clone()
31253 }
31254}
31255impl MessageData for VFR_HUD_DATA {
31256 type Message = MavMessage;
31257 const ID: u32 = 74u32;
31258 const NAME: &'static str = "VFR_HUD";
31259 const EXTRA_CRC: u8 = 20u8;
31260 const ENCODED_LEN: usize = 20usize;
31261 fn deser(
31262 _version: MavlinkVersion,
31263 __input: &[u8],
31264 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31265 let avail_len = __input.len();
31266 let mut payload_buf = [0; Self::ENCODED_LEN];
31267 let mut buf = if avail_len < Self::ENCODED_LEN {
31268 payload_buf[0..avail_len].copy_from_slice(__input);
31269 Bytes::new(&payload_buf)
31270 } else {
31271 Bytes::new(__input)
31272 };
31273 let mut __struct = Self::default();
31274 __struct.airspeed = buf.get_f32_le();
31275 __struct.groundspeed = buf.get_f32_le();
31276 __struct.alt = buf.get_f32_le();
31277 __struct.climb = buf.get_f32_le();
31278 __struct.heading = buf.get_i16_le();
31279 __struct.throttle = buf.get_u16_le();
31280 Ok(__struct)
31281 }
31282 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31283 let mut __tmp = BytesMut::new(bytes);
31284 #[allow(clippy::absurd_extreme_comparisons)]
31285 #[allow(unused_comparisons)]
31286 if __tmp.remaining() < Self::ENCODED_LEN {
31287 panic!(
31288 "buffer is too small (need {} bytes, but got {})",
31289 Self::ENCODED_LEN,
31290 __tmp.remaining(),
31291 )
31292 }
31293 __tmp.put_f32_le(self.airspeed);
31294 __tmp.put_f32_le(self.groundspeed);
31295 __tmp.put_f32_le(self.alt);
31296 __tmp.put_f32_le(self.climb);
31297 __tmp.put_i16_le(self.heading);
31298 __tmp.put_u16_le(self.throttle);
31299 if matches!(version, MavlinkVersion::V2) {
31300 let len = __tmp.len();
31301 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31302 } else {
31303 __tmp.len()
31304 }
31305 }
31306}
31307#[doc = "Vibration levels and accelerometer clipping."]
31308#[doc = ""]
31309#[doc = "ID: 241"]
31310#[derive(Debug, Clone, PartialEq)]
31311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31312#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31313#[cfg_attr(feature = "ts", derive(TS))]
31314#[cfg_attr(feature = "ts", ts(export))]
31315pub struct VIBRATION_DATA {
31316 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31317 pub time_usec: u64,
31318 #[doc = "Vibration levels on X-axis"]
31319 pub vibration_x: f32,
31320 #[doc = "Vibration levels on Y-axis"]
31321 pub vibration_y: f32,
31322 #[doc = "Vibration levels on Z-axis"]
31323 pub vibration_z: f32,
31324 #[doc = "first accelerometer clipping count"]
31325 pub clipping_0: u32,
31326 #[doc = "second accelerometer clipping count"]
31327 pub clipping_1: u32,
31328 #[doc = "third accelerometer clipping count"]
31329 pub clipping_2: u32,
31330}
31331impl VIBRATION_DATA {
31332 pub const ENCODED_LEN: usize = 32usize;
31333 pub const DEFAULT: Self = Self {
31334 time_usec: 0_u64,
31335 vibration_x: 0.0_f32,
31336 vibration_y: 0.0_f32,
31337 vibration_z: 0.0_f32,
31338 clipping_0: 0_u32,
31339 clipping_1: 0_u32,
31340 clipping_2: 0_u32,
31341 };
31342 #[cfg(feature = "arbitrary")]
31343 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31344 use arbitrary::{Arbitrary, Unstructured};
31345 let mut buf = [0u8; 1024];
31346 rng.fill_bytes(&mut buf);
31347 let mut unstructured = Unstructured::new(&buf);
31348 Self::arbitrary(&mut unstructured).unwrap_or_default()
31349 }
31350}
31351impl Default for VIBRATION_DATA {
31352 fn default() -> Self {
31353 Self::DEFAULT.clone()
31354 }
31355}
31356impl MessageData for VIBRATION_DATA {
31357 type Message = MavMessage;
31358 const ID: u32 = 241u32;
31359 const NAME: &'static str = "VIBRATION";
31360 const EXTRA_CRC: u8 = 90u8;
31361 const ENCODED_LEN: usize = 32usize;
31362 fn deser(
31363 _version: MavlinkVersion,
31364 __input: &[u8],
31365 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31366 let avail_len = __input.len();
31367 let mut payload_buf = [0; Self::ENCODED_LEN];
31368 let mut buf = if avail_len < Self::ENCODED_LEN {
31369 payload_buf[0..avail_len].copy_from_slice(__input);
31370 Bytes::new(&payload_buf)
31371 } else {
31372 Bytes::new(__input)
31373 };
31374 let mut __struct = Self::default();
31375 __struct.time_usec = buf.get_u64_le();
31376 __struct.vibration_x = buf.get_f32_le();
31377 __struct.vibration_y = buf.get_f32_le();
31378 __struct.vibration_z = buf.get_f32_le();
31379 __struct.clipping_0 = buf.get_u32_le();
31380 __struct.clipping_1 = buf.get_u32_le();
31381 __struct.clipping_2 = buf.get_u32_le();
31382 Ok(__struct)
31383 }
31384 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31385 let mut __tmp = BytesMut::new(bytes);
31386 #[allow(clippy::absurd_extreme_comparisons)]
31387 #[allow(unused_comparisons)]
31388 if __tmp.remaining() < Self::ENCODED_LEN {
31389 panic!(
31390 "buffer is too small (need {} bytes, but got {})",
31391 Self::ENCODED_LEN,
31392 __tmp.remaining(),
31393 )
31394 }
31395 __tmp.put_u64_le(self.time_usec);
31396 __tmp.put_f32_le(self.vibration_x);
31397 __tmp.put_f32_le(self.vibration_y);
31398 __tmp.put_f32_le(self.vibration_z);
31399 __tmp.put_u32_le(self.clipping_0);
31400 __tmp.put_u32_le(self.clipping_1);
31401 __tmp.put_u32_le(self.clipping_2);
31402 if matches!(version, MavlinkVersion::V2) {
31403 let len = __tmp.len();
31404 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31405 } else {
31406 __tmp.len()
31407 }
31408 }
31409}
31410#[doc = "Global position estimate from a Vicon motion system source."]
31411#[doc = ""]
31412#[doc = "ID: 104"]
31413#[derive(Debug, Clone, PartialEq)]
31414#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31415#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31416#[cfg_attr(feature = "ts", derive(TS))]
31417#[cfg_attr(feature = "ts", ts(export))]
31418pub struct VICON_POSITION_ESTIMATE_DATA {
31419 #[doc = "Timestamp (UNIX time or time since system boot)"]
31420 pub usec: u64,
31421 #[doc = "Global X position"]
31422 pub x: f32,
31423 #[doc = "Global Y position"]
31424 pub y: f32,
31425 #[doc = "Global Z position"]
31426 pub z: f32,
31427 #[doc = "Roll angle"]
31428 pub roll: f32,
31429 #[doc = "Pitch angle"]
31430 pub pitch: f32,
31431 #[doc = "Yaw angle"]
31432 pub yaw: f32,
31433 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31434 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31435 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31436 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31437 pub covariance: [f32; 21],
31438}
31439impl VICON_POSITION_ESTIMATE_DATA {
31440 pub const ENCODED_LEN: usize = 116usize;
31441 pub const DEFAULT: Self = Self {
31442 usec: 0_u64,
31443 x: 0.0_f32,
31444 y: 0.0_f32,
31445 z: 0.0_f32,
31446 roll: 0.0_f32,
31447 pitch: 0.0_f32,
31448 yaw: 0.0_f32,
31449 covariance: [0.0_f32; 21usize],
31450 };
31451 #[cfg(feature = "arbitrary")]
31452 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31453 use arbitrary::{Arbitrary, Unstructured};
31454 let mut buf = [0u8; 1024];
31455 rng.fill_bytes(&mut buf);
31456 let mut unstructured = Unstructured::new(&buf);
31457 Self::arbitrary(&mut unstructured).unwrap_or_default()
31458 }
31459}
31460impl Default for VICON_POSITION_ESTIMATE_DATA {
31461 fn default() -> Self {
31462 Self::DEFAULT.clone()
31463 }
31464}
31465impl MessageData for VICON_POSITION_ESTIMATE_DATA {
31466 type Message = MavMessage;
31467 const ID: u32 = 104u32;
31468 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
31469 const EXTRA_CRC: u8 = 56u8;
31470 const ENCODED_LEN: usize = 116usize;
31471 fn deser(
31472 _version: MavlinkVersion,
31473 __input: &[u8],
31474 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31475 let avail_len = __input.len();
31476 let mut payload_buf = [0; Self::ENCODED_LEN];
31477 let mut buf = if avail_len < Self::ENCODED_LEN {
31478 payload_buf[0..avail_len].copy_from_slice(__input);
31479 Bytes::new(&payload_buf)
31480 } else {
31481 Bytes::new(__input)
31482 };
31483 let mut __struct = Self::default();
31484 __struct.usec = buf.get_u64_le();
31485 __struct.x = buf.get_f32_le();
31486 __struct.y = buf.get_f32_le();
31487 __struct.z = buf.get_f32_le();
31488 __struct.roll = buf.get_f32_le();
31489 __struct.pitch = buf.get_f32_le();
31490 __struct.yaw = buf.get_f32_le();
31491 for v in &mut __struct.covariance {
31492 let val = buf.get_f32_le();
31493 *v = val;
31494 }
31495 Ok(__struct)
31496 }
31497 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31498 let mut __tmp = BytesMut::new(bytes);
31499 #[allow(clippy::absurd_extreme_comparisons)]
31500 #[allow(unused_comparisons)]
31501 if __tmp.remaining() < Self::ENCODED_LEN {
31502 panic!(
31503 "buffer is too small (need {} bytes, but got {})",
31504 Self::ENCODED_LEN,
31505 __tmp.remaining(),
31506 )
31507 }
31508 __tmp.put_u64_le(self.usec);
31509 __tmp.put_f32_le(self.x);
31510 __tmp.put_f32_le(self.y);
31511 __tmp.put_f32_le(self.z);
31512 __tmp.put_f32_le(self.roll);
31513 __tmp.put_f32_le(self.pitch);
31514 __tmp.put_f32_le(self.yaw);
31515 if matches!(version, MavlinkVersion::V2) {
31516 for val in &self.covariance {
31517 __tmp.put_f32_le(*val);
31518 }
31519 let len = __tmp.len();
31520 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31521 } else {
31522 __tmp.len()
31523 }
31524 }
31525}
31526#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
31527#[doc = ""]
31528#[doc = "ID: 269"]
31529#[derive(Debug, Clone, PartialEq)]
31530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31532#[cfg_attr(feature = "ts", derive(TS))]
31533#[cfg_attr(feature = "ts", ts(export))]
31534pub struct VIDEO_STREAM_INFORMATION_DATA {
31535 #[doc = "Frame rate."]
31536 pub framerate: f32,
31537 #[doc = "Bit rate."]
31538 pub bitrate: u32,
31539 #[doc = "Bitmap of stream status flags."]
31540 pub flags: VideoStreamStatusFlags,
31541 #[doc = "Horizontal resolution."]
31542 pub resolution_h: u16,
31543 #[doc = "Vertical resolution."]
31544 pub resolution_v: u16,
31545 #[doc = "Video image rotation clockwise."]
31546 pub rotation: u16,
31547 #[doc = "Horizontal Field of view."]
31548 pub hfov: u16,
31549 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31550 pub stream_id: u8,
31551 #[doc = "Number of streams available."]
31552 pub count: u8,
31553 #[doc = "Type of stream."]
31554 pub mavtype: VideoStreamType,
31555 #[doc = "Stream name."]
31556 #[cfg_attr(feature = "ts", ts(type = "string"))]
31557 pub name: CharArray<32>,
31558 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
31559 #[cfg_attr(feature = "ts", ts(type = "string"))]
31560 pub uri: CharArray<160>,
31561 #[doc = "Encoding of stream."]
31562 #[cfg_attr(feature = "serde", serde(default))]
31563 pub encoding: VideoStreamEncoding,
31564 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31565 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31566 pub camera_device_id: u8,
31567}
31568impl VIDEO_STREAM_INFORMATION_DATA {
31569 pub const ENCODED_LEN: usize = 215usize;
31570 pub const DEFAULT: Self = Self {
31571 framerate: 0.0_f32,
31572 bitrate: 0_u32,
31573 flags: VideoStreamStatusFlags::DEFAULT,
31574 resolution_h: 0_u16,
31575 resolution_v: 0_u16,
31576 rotation: 0_u16,
31577 hfov: 0_u16,
31578 stream_id: 0_u8,
31579 count: 0_u8,
31580 mavtype: VideoStreamType::DEFAULT,
31581 name: CharArray::new([0_u8; 32usize]),
31582 uri: CharArray::new([0_u8; 160usize]),
31583 encoding: VideoStreamEncoding::DEFAULT,
31584 camera_device_id: 0_u8,
31585 };
31586 #[cfg(feature = "arbitrary")]
31587 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31588 use arbitrary::{Arbitrary, Unstructured};
31589 let mut buf = [0u8; 1024];
31590 rng.fill_bytes(&mut buf);
31591 let mut unstructured = Unstructured::new(&buf);
31592 Self::arbitrary(&mut unstructured).unwrap_or_default()
31593 }
31594}
31595impl Default for VIDEO_STREAM_INFORMATION_DATA {
31596 fn default() -> Self {
31597 Self::DEFAULT.clone()
31598 }
31599}
31600impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
31601 type Message = MavMessage;
31602 const ID: u32 = 269u32;
31603 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
31604 const EXTRA_CRC: u8 = 109u8;
31605 const ENCODED_LEN: usize = 215usize;
31606 fn deser(
31607 _version: MavlinkVersion,
31608 __input: &[u8],
31609 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31610 let avail_len = __input.len();
31611 let mut payload_buf = [0; Self::ENCODED_LEN];
31612 let mut buf = if avail_len < Self::ENCODED_LEN {
31613 payload_buf[0..avail_len].copy_from_slice(__input);
31614 Bytes::new(&payload_buf)
31615 } else {
31616 Bytes::new(__input)
31617 };
31618 let mut __struct = Self::default();
31619 __struct.framerate = buf.get_f32_le();
31620 __struct.bitrate = buf.get_u32_le();
31621 let tmp = buf.get_u16_le();
31622 __struct.flags =
31623 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
31624 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31625 flag_type: "VideoStreamStatusFlags",
31626 value: tmp as u64,
31627 })?;
31628 __struct.resolution_h = buf.get_u16_le();
31629 __struct.resolution_v = buf.get_u16_le();
31630 __struct.rotation = buf.get_u16_le();
31631 __struct.hfov = buf.get_u16_le();
31632 __struct.stream_id = buf.get_u8();
31633 __struct.count = buf.get_u8();
31634 let tmp = buf.get_u8();
31635 __struct.mavtype =
31636 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31637 enum_type: "VideoStreamType",
31638 value: tmp as u64,
31639 })?;
31640 let mut tmp = [0_u8; 32usize];
31641 for v in &mut tmp {
31642 *v = buf.get_u8();
31643 }
31644 __struct.name = CharArray::new(tmp);
31645 let mut tmp = [0_u8; 160usize];
31646 for v in &mut tmp {
31647 *v = buf.get_u8();
31648 }
31649 __struct.uri = CharArray::new(tmp);
31650 let tmp = buf.get_u8();
31651 __struct.encoding =
31652 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31653 enum_type: "VideoStreamEncoding",
31654 value: tmp as u64,
31655 })?;
31656 __struct.camera_device_id = buf.get_u8();
31657 Ok(__struct)
31658 }
31659 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31660 let mut __tmp = BytesMut::new(bytes);
31661 #[allow(clippy::absurd_extreme_comparisons)]
31662 #[allow(unused_comparisons)]
31663 if __tmp.remaining() < Self::ENCODED_LEN {
31664 panic!(
31665 "buffer is too small (need {} bytes, but got {})",
31666 Self::ENCODED_LEN,
31667 __tmp.remaining(),
31668 )
31669 }
31670 __tmp.put_f32_le(self.framerate);
31671 __tmp.put_u32_le(self.bitrate);
31672 __tmp.put_u16_le(self.flags.bits() as u16);
31673 __tmp.put_u16_le(self.resolution_h);
31674 __tmp.put_u16_le(self.resolution_v);
31675 __tmp.put_u16_le(self.rotation);
31676 __tmp.put_u16_le(self.hfov);
31677 __tmp.put_u8(self.stream_id);
31678 __tmp.put_u8(self.count);
31679 __tmp.put_u8(self.mavtype as u8);
31680 for val in &self.name {
31681 __tmp.put_u8(*val);
31682 }
31683 for val in &self.uri {
31684 __tmp.put_u8(*val);
31685 }
31686 if matches!(version, MavlinkVersion::V2) {
31687 __tmp.put_u8(self.encoding as u8);
31688 __tmp.put_u8(self.camera_device_id);
31689 let len = __tmp.len();
31690 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31691 } else {
31692 __tmp.len()
31693 }
31694 }
31695}
31696#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
31697#[doc = ""]
31698#[doc = "ID: 270"]
31699#[derive(Debug, Clone, PartialEq)]
31700#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31701#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31702#[cfg_attr(feature = "ts", derive(TS))]
31703#[cfg_attr(feature = "ts", ts(export))]
31704pub struct VIDEO_STREAM_STATUS_DATA {
31705 #[doc = "Frame rate"]
31706 pub framerate: f32,
31707 #[doc = "Bit rate"]
31708 pub bitrate: u32,
31709 #[doc = "Bitmap of stream status flags"]
31710 pub flags: VideoStreamStatusFlags,
31711 #[doc = "Horizontal resolution"]
31712 pub resolution_h: u16,
31713 #[doc = "Vertical resolution"]
31714 pub resolution_v: u16,
31715 #[doc = "Video image rotation clockwise"]
31716 pub rotation: u16,
31717 #[doc = "Horizontal Field of view"]
31718 pub hfov: u16,
31719 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31720 pub stream_id: u8,
31721 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31722 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31723 pub camera_device_id: u8,
31724}
31725impl VIDEO_STREAM_STATUS_DATA {
31726 pub const ENCODED_LEN: usize = 20usize;
31727 pub const DEFAULT: Self = Self {
31728 framerate: 0.0_f32,
31729 bitrate: 0_u32,
31730 flags: VideoStreamStatusFlags::DEFAULT,
31731 resolution_h: 0_u16,
31732 resolution_v: 0_u16,
31733 rotation: 0_u16,
31734 hfov: 0_u16,
31735 stream_id: 0_u8,
31736 camera_device_id: 0_u8,
31737 };
31738 #[cfg(feature = "arbitrary")]
31739 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31740 use arbitrary::{Arbitrary, Unstructured};
31741 let mut buf = [0u8; 1024];
31742 rng.fill_bytes(&mut buf);
31743 let mut unstructured = Unstructured::new(&buf);
31744 Self::arbitrary(&mut unstructured).unwrap_or_default()
31745 }
31746}
31747impl Default for VIDEO_STREAM_STATUS_DATA {
31748 fn default() -> Self {
31749 Self::DEFAULT.clone()
31750 }
31751}
31752impl MessageData for VIDEO_STREAM_STATUS_DATA {
31753 type Message = MavMessage;
31754 const ID: u32 = 270u32;
31755 const NAME: &'static str = "VIDEO_STREAM_STATUS";
31756 const EXTRA_CRC: u8 = 59u8;
31757 const ENCODED_LEN: usize = 20usize;
31758 fn deser(
31759 _version: MavlinkVersion,
31760 __input: &[u8],
31761 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31762 let avail_len = __input.len();
31763 let mut payload_buf = [0; Self::ENCODED_LEN];
31764 let mut buf = if avail_len < Self::ENCODED_LEN {
31765 payload_buf[0..avail_len].copy_from_slice(__input);
31766 Bytes::new(&payload_buf)
31767 } else {
31768 Bytes::new(__input)
31769 };
31770 let mut __struct = Self::default();
31771 __struct.framerate = buf.get_f32_le();
31772 __struct.bitrate = buf.get_u32_le();
31773 let tmp = buf.get_u16_le();
31774 __struct.flags =
31775 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
31776 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31777 flag_type: "VideoStreamStatusFlags",
31778 value: tmp as u64,
31779 })?;
31780 __struct.resolution_h = buf.get_u16_le();
31781 __struct.resolution_v = buf.get_u16_le();
31782 __struct.rotation = buf.get_u16_le();
31783 __struct.hfov = buf.get_u16_le();
31784 __struct.stream_id = buf.get_u8();
31785 __struct.camera_device_id = buf.get_u8();
31786 Ok(__struct)
31787 }
31788 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31789 let mut __tmp = BytesMut::new(bytes);
31790 #[allow(clippy::absurd_extreme_comparisons)]
31791 #[allow(unused_comparisons)]
31792 if __tmp.remaining() < Self::ENCODED_LEN {
31793 panic!(
31794 "buffer is too small (need {} bytes, but got {})",
31795 Self::ENCODED_LEN,
31796 __tmp.remaining(),
31797 )
31798 }
31799 __tmp.put_f32_le(self.framerate);
31800 __tmp.put_u32_le(self.bitrate);
31801 __tmp.put_u16_le(self.flags.bits() as u16);
31802 __tmp.put_u16_le(self.resolution_h);
31803 __tmp.put_u16_le(self.resolution_v);
31804 __tmp.put_u16_le(self.rotation);
31805 __tmp.put_u16_le(self.hfov);
31806 __tmp.put_u8(self.stream_id);
31807 if matches!(version, MavlinkVersion::V2) {
31808 __tmp.put_u8(self.camera_device_id);
31809 let len = __tmp.len();
31810 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31811 } else {
31812 __tmp.len()
31813 }
31814 }
31815}
31816#[doc = "Local position/attitude estimate from a vision source."]
31817#[doc = ""]
31818#[doc = "ID: 102"]
31819#[derive(Debug, Clone, PartialEq)]
31820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31821#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31822#[cfg_attr(feature = "ts", derive(TS))]
31823#[cfg_attr(feature = "ts", ts(export))]
31824pub struct VISION_POSITION_ESTIMATE_DATA {
31825 #[doc = "Timestamp (UNIX time or time since system boot)"]
31826 pub usec: u64,
31827 #[doc = "Local X position"]
31828 pub x: f32,
31829 #[doc = "Local Y position"]
31830 pub y: f32,
31831 #[doc = "Local Z position"]
31832 pub z: f32,
31833 #[doc = "Roll angle"]
31834 pub roll: f32,
31835 #[doc = "Pitch angle"]
31836 pub pitch: f32,
31837 #[doc = "Yaw angle"]
31838 pub yaw: f32,
31839 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31840 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31841 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31842 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31843 pub covariance: [f32; 21],
31844 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31845 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31846 pub reset_counter: u8,
31847}
31848impl VISION_POSITION_ESTIMATE_DATA {
31849 pub const ENCODED_LEN: usize = 117usize;
31850 pub const DEFAULT: Self = Self {
31851 usec: 0_u64,
31852 x: 0.0_f32,
31853 y: 0.0_f32,
31854 z: 0.0_f32,
31855 roll: 0.0_f32,
31856 pitch: 0.0_f32,
31857 yaw: 0.0_f32,
31858 covariance: [0.0_f32; 21usize],
31859 reset_counter: 0_u8,
31860 };
31861 #[cfg(feature = "arbitrary")]
31862 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31863 use arbitrary::{Arbitrary, Unstructured};
31864 let mut buf = [0u8; 1024];
31865 rng.fill_bytes(&mut buf);
31866 let mut unstructured = Unstructured::new(&buf);
31867 Self::arbitrary(&mut unstructured).unwrap_or_default()
31868 }
31869}
31870impl Default for VISION_POSITION_ESTIMATE_DATA {
31871 fn default() -> Self {
31872 Self::DEFAULT.clone()
31873 }
31874}
31875impl MessageData for VISION_POSITION_ESTIMATE_DATA {
31876 type Message = MavMessage;
31877 const ID: u32 = 102u32;
31878 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
31879 const EXTRA_CRC: u8 = 158u8;
31880 const ENCODED_LEN: usize = 117usize;
31881 fn deser(
31882 _version: MavlinkVersion,
31883 __input: &[u8],
31884 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31885 let avail_len = __input.len();
31886 let mut payload_buf = [0; Self::ENCODED_LEN];
31887 let mut buf = if avail_len < Self::ENCODED_LEN {
31888 payload_buf[0..avail_len].copy_from_slice(__input);
31889 Bytes::new(&payload_buf)
31890 } else {
31891 Bytes::new(__input)
31892 };
31893 let mut __struct = Self::default();
31894 __struct.usec = buf.get_u64_le();
31895 __struct.x = buf.get_f32_le();
31896 __struct.y = buf.get_f32_le();
31897 __struct.z = buf.get_f32_le();
31898 __struct.roll = buf.get_f32_le();
31899 __struct.pitch = buf.get_f32_le();
31900 __struct.yaw = buf.get_f32_le();
31901 for v in &mut __struct.covariance {
31902 let val = buf.get_f32_le();
31903 *v = val;
31904 }
31905 __struct.reset_counter = buf.get_u8();
31906 Ok(__struct)
31907 }
31908 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31909 let mut __tmp = BytesMut::new(bytes);
31910 #[allow(clippy::absurd_extreme_comparisons)]
31911 #[allow(unused_comparisons)]
31912 if __tmp.remaining() < Self::ENCODED_LEN {
31913 panic!(
31914 "buffer is too small (need {} bytes, but got {})",
31915 Self::ENCODED_LEN,
31916 __tmp.remaining(),
31917 )
31918 }
31919 __tmp.put_u64_le(self.usec);
31920 __tmp.put_f32_le(self.x);
31921 __tmp.put_f32_le(self.y);
31922 __tmp.put_f32_le(self.z);
31923 __tmp.put_f32_le(self.roll);
31924 __tmp.put_f32_le(self.pitch);
31925 __tmp.put_f32_le(self.yaw);
31926 if matches!(version, MavlinkVersion::V2) {
31927 for val in &self.covariance {
31928 __tmp.put_f32_le(*val);
31929 }
31930 __tmp.put_u8(self.reset_counter);
31931 let len = __tmp.len();
31932 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31933 } else {
31934 __tmp.len()
31935 }
31936 }
31937}
31938#[doc = "Speed estimate from a vision source."]
31939#[doc = ""]
31940#[doc = "ID: 103"]
31941#[derive(Debug, Clone, PartialEq)]
31942#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31943#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31944#[cfg_attr(feature = "ts", derive(TS))]
31945#[cfg_attr(feature = "ts", ts(export))]
31946pub struct VISION_SPEED_ESTIMATE_DATA {
31947 #[doc = "Timestamp (UNIX time or time since system boot)"]
31948 pub usec: u64,
31949 #[doc = "Global X speed"]
31950 pub x: f32,
31951 #[doc = "Global Y speed"]
31952 pub y: f32,
31953 #[doc = "Global Z speed"]
31954 pub z: f32,
31955 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
31956 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31957 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31958 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31959 pub covariance: [f32; 9],
31960 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31961 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31962 pub reset_counter: u8,
31963}
31964impl VISION_SPEED_ESTIMATE_DATA {
31965 pub const ENCODED_LEN: usize = 57usize;
31966 pub const DEFAULT: Self = Self {
31967 usec: 0_u64,
31968 x: 0.0_f32,
31969 y: 0.0_f32,
31970 z: 0.0_f32,
31971 covariance: [0.0_f32; 9usize],
31972 reset_counter: 0_u8,
31973 };
31974 #[cfg(feature = "arbitrary")]
31975 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31976 use arbitrary::{Arbitrary, Unstructured};
31977 let mut buf = [0u8; 1024];
31978 rng.fill_bytes(&mut buf);
31979 let mut unstructured = Unstructured::new(&buf);
31980 Self::arbitrary(&mut unstructured).unwrap_or_default()
31981 }
31982}
31983impl Default for VISION_SPEED_ESTIMATE_DATA {
31984 fn default() -> Self {
31985 Self::DEFAULT.clone()
31986 }
31987}
31988impl MessageData for VISION_SPEED_ESTIMATE_DATA {
31989 type Message = MavMessage;
31990 const ID: u32 = 103u32;
31991 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
31992 const EXTRA_CRC: u8 = 208u8;
31993 const ENCODED_LEN: usize = 57usize;
31994 fn deser(
31995 _version: MavlinkVersion,
31996 __input: &[u8],
31997 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31998 let avail_len = __input.len();
31999 let mut payload_buf = [0; Self::ENCODED_LEN];
32000 let mut buf = if avail_len < Self::ENCODED_LEN {
32001 payload_buf[0..avail_len].copy_from_slice(__input);
32002 Bytes::new(&payload_buf)
32003 } else {
32004 Bytes::new(__input)
32005 };
32006 let mut __struct = Self::default();
32007 __struct.usec = buf.get_u64_le();
32008 __struct.x = buf.get_f32_le();
32009 __struct.y = buf.get_f32_le();
32010 __struct.z = buf.get_f32_le();
32011 for v in &mut __struct.covariance {
32012 let val = buf.get_f32_le();
32013 *v = val;
32014 }
32015 __struct.reset_counter = buf.get_u8();
32016 Ok(__struct)
32017 }
32018 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32019 let mut __tmp = BytesMut::new(bytes);
32020 #[allow(clippy::absurd_extreme_comparisons)]
32021 #[allow(unused_comparisons)]
32022 if __tmp.remaining() < Self::ENCODED_LEN {
32023 panic!(
32024 "buffer is too small (need {} bytes, but got {})",
32025 Self::ENCODED_LEN,
32026 __tmp.remaining(),
32027 )
32028 }
32029 __tmp.put_u64_le(self.usec);
32030 __tmp.put_f32_le(self.x);
32031 __tmp.put_f32_le(self.y);
32032 __tmp.put_f32_le(self.z);
32033 if matches!(version, MavlinkVersion::V2) {
32034 for val in &self.covariance {
32035 __tmp.put_f32_le(*val);
32036 }
32037 __tmp.put_u8(self.reset_counter);
32038 let len = __tmp.len();
32039 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32040 } else {
32041 __tmp.len()
32042 }
32043 }
32044}
32045#[doc = "Cumulative distance traveled for each reported wheel."]
32046#[doc = ""]
32047#[doc = "ID: 9000"]
32048#[derive(Debug, Clone, PartialEq)]
32049#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32050#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32051#[cfg_attr(feature = "ts", derive(TS))]
32052#[cfg_attr(feature = "ts", ts(export))]
32053pub struct WHEEL_DISTANCE_DATA {
32054 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32055 pub time_usec: u64,
32056 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
32057 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32058 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32059 pub distance: [f64; 16],
32060 #[doc = "Number of wheels reported."]
32061 pub count: u8,
32062}
32063impl WHEEL_DISTANCE_DATA {
32064 pub const ENCODED_LEN: usize = 137usize;
32065 pub const DEFAULT: Self = Self {
32066 time_usec: 0_u64,
32067 distance: [0.0_f64; 16usize],
32068 count: 0_u8,
32069 };
32070 #[cfg(feature = "arbitrary")]
32071 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32072 use arbitrary::{Arbitrary, Unstructured};
32073 let mut buf = [0u8; 1024];
32074 rng.fill_bytes(&mut buf);
32075 let mut unstructured = Unstructured::new(&buf);
32076 Self::arbitrary(&mut unstructured).unwrap_or_default()
32077 }
32078}
32079impl Default for WHEEL_DISTANCE_DATA {
32080 fn default() -> Self {
32081 Self::DEFAULT.clone()
32082 }
32083}
32084impl MessageData for WHEEL_DISTANCE_DATA {
32085 type Message = MavMessage;
32086 const ID: u32 = 9000u32;
32087 const NAME: &'static str = "WHEEL_DISTANCE";
32088 const EXTRA_CRC: u8 = 113u8;
32089 const ENCODED_LEN: usize = 137usize;
32090 fn deser(
32091 _version: MavlinkVersion,
32092 __input: &[u8],
32093 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32094 let avail_len = __input.len();
32095 let mut payload_buf = [0; Self::ENCODED_LEN];
32096 let mut buf = if avail_len < Self::ENCODED_LEN {
32097 payload_buf[0..avail_len].copy_from_slice(__input);
32098 Bytes::new(&payload_buf)
32099 } else {
32100 Bytes::new(__input)
32101 };
32102 let mut __struct = Self::default();
32103 __struct.time_usec = buf.get_u64_le();
32104 for v in &mut __struct.distance {
32105 let val = buf.get_f64_le();
32106 *v = val;
32107 }
32108 __struct.count = buf.get_u8();
32109 Ok(__struct)
32110 }
32111 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32112 let mut __tmp = BytesMut::new(bytes);
32113 #[allow(clippy::absurd_extreme_comparisons)]
32114 #[allow(unused_comparisons)]
32115 if __tmp.remaining() < Self::ENCODED_LEN {
32116 panic!(
32117 "buffer is too small (need {} bytes, but got {})",
32118 Self::ENCODED_LEN,
32119 __tmp.remaining(),
32120 )
32121 }
32122 __tmp.put_u64_le(self.time_usec);
32123 for val in &self.distance {
32124 __tmp.put_f64_le(*val);
32125 }
32126 __tmp.put_u8(self.count);
32127 if matches!(version, MavlinkVersion::V2) {
32128 let len = __tmp.len();
32129 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32130 } else {
32131 __tmp.len()
32132 }
32133 }
32134}
32135#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32136#[doc = ""]
32137#[doc = "ID: 299"]
32138#[derive(Debug, Clone, PartialEq)]
32139#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32140#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32141#[cfg_attr(feature = "ts", derive(TS))]
32142#[cfg_attr(feature = "ts", ts(export))]
32143pub struct WIFI_CONFIG_AP_DATA {
32144 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
32145 #[cfg_attr(feature = "ts", ts(type = "string"))]
32146 pub ssid: CharArray<32>,
32147 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
32148 #[cfg_attr(feature = "ts", ts(type = "string"))]
32149 pub password: CharArray<64>,
32150 #[doc = "WiFi Mode."]
32151 #[cfg_attr(feature = "serde", serde(default))]
32152 pub mode: WifiConfigApMode,
32153 #[doc = "Message acceptance response (sent back to GS)."]
32154 #[cfg_attr(feature = "serde", serde(default))]
32155 pub response: WifiConfigApResponse,
32156}
32157impl WIFI_CONFIG_AP_DATA {
32158 pub const ENCODED_LEN: usize = 98usize;
32159 pub const DEFAULT: Self = Self {
32160 ssid: CharArray::new([0_u8; 32usize]),
32161 password: CharArray::new([0_u8; 64usize]),
32162 mode: WifiConfigApMode::DEFAULT,
32163 response: WifiConfigApResponse::DEFAULT,
32164 };
32165 #[cfg(feature = "arbitrary")]
32166 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32167 use arbitrary::{Arbitrary, Unstructured};
32168 let mut buf = [0u8; 1024];
32169 rng.fill_bytes(&mut buf);
32170 let mut unstructured = Unstructured::new(&buf);
32171 Self::arbitrary(&mut unstructured).unwrap_or_default()
32172 }
32173}
32174impl Default for WIFI_CONFIG_AP_DATA {
32175 fn default() -> Self {
32176 Self::DEFAULT.clone()
32177 }
32178}
32179impl MessageData for WIFI_CONFIG_AP_DATA {
32180 type Message = MavMessage;
32181 const ID: u32 = 299u32;
32182 const NAME: &'static str = "WIFI_CONFIG_AP";
32183 const EXTRA_CRC: u8 = 19u8;
32184 const ENCODED_LEN: usize = 98usize;
32185 fn deser(
32186 _version: MavlinkVersion,
32187 __input: &[u8],
32188 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32189 let avail_len = __input.len();
32190 let mut payload_buf = [0; Self::ENCODED_LEN];
32191 let mut buf = if avail_len < Self::ENCODED_LEN {
32192 payload_buf[0..avail_len].copy_from_slice(__input);
32193 Bytes::new(&payload_buf)
32194 } else {
32195 Bytes::new(__input)
32196 };
32197 let mut __struct = Self::default();
32198 let mut tmp = [0_u8; 32usize];
32199 for v in &mut tmp {
32200 *v = buf.get_u8();
32201 }
32202 __struct.ssid = CharArray::new(tmp);
32203 let mut tmp = [0_u8; 64usize];
32204 for v in &mut tmp {
32205 *v = buf.get_u8();
32206 }
32207 __struct.password = CharArray::new(tmp);
32208 let tmp = buf.get_i8();
32209 __struct.mode =
32210 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32211 enum_type: "WifiConfigApMode",
32212 value: tmp as u64,
32213 })?;
32214 let tmp = buf.get_i8();
32215 __struct.response =
32216 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32217 enum_type: "WifiConfigApResponse",
32218 value: tmp as u64,
32219 })?;
32220 Ok(__struct)
32221 }
32222 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32223 let mut __tmp = BytesMut::new(bytes);
32224 #[allow(clippy::absurd_extreme_comparisons)]
32225 #[allow(unused_comparisons)]
32226 if __tmp.remaining() < Self::ENCODED_LEN {
32227 panic!(
32228 "buffer is too small (need {} bytes, but got {})",
32229 Self::ENCODED_LEN,
32230 __tmp.remaining(),
32231 )
32232 }
32233 for val in &self.ssid {
32234 __tmp.put_u8(*val);
32235 }
32236 for val in &self.password {
32237 __tmp.put_u8(*val);
32238 }
32239 if matches!(version, MavlinkVersion::V2) {
32240 __tmp.put_i8(self.mode as i8);
32241 __tmp.put_i8(self.response as i8);
32242 let len = __tmp.len();
32243 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32244 } else {
32245 __tmp.len()
32246 }
32247 }
32248}
32249#[doc = "Winch status."]
32250#[doc = ""]
32251#[doc = "ID: 9005"]
32252#[derive(Debug, Clone, PartialEq)]
32253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32254#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32255#[cfg_attr(feature = "ts", derive(TS))]
32256#[cfg_attr(feature = "ts", ts(export))]
32257pub struct WINCH_STATUS_DATA {
32258 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32259 pub time_usec: u64,
32260 #[doc = "Length of line released. NaN if unknown"]
32261 pub line_length: f32,
32262 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
32263 pub speed: f32,
32264 #[doc = "Tension on the line. NaN if unknown"]
32265 pub tension: f32,
32266 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
32267 pub voltage: f32,
32268 #[doc = "Current draw from the winch. NaN if unknown"]
32269 pub current: f32,
32270 #[doc = "Status flags"]
32271 pub status: MavWinchStatusFlag,
32272 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
32273 pub temperature: i16,
32274}
32275impl WINCH_STATUS_DATA {
32276 pub const ENCODED_LEN: usize = 34usize;
32277 pub const DEFAULT: Self = Self {
32278 time_usec: 0_u64,
32279 line_length: 0.0_f32,
32280 speed: 0.0_f32,
32281 tension: 0.0_f32,
32282 voltage: 0.0_f32,
32283 current: 0.0_f32,
32284 status: MavWinchStatusFlag::DEFAULT,
32285 temperature: 0_i16,
32286 };
32287 #[cfg(feature = "arbitrary")]
32288 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32289 use arbitrary::{Arbitrary, Unstructured};
32290 let mut buf = [0u8; 1024];
32291 rng.fill_bytes(&mut buf);
32292 let mut unstructured = Unstructured::new(&buf);
32293 Self::arbitrary(&mut unstructured).unwrap_or_default()
32294 }
32295}
32296impl Default for WINCH_STATUS_DATA {
32297 fn default() -> Self {
32298 Self::DEFAULT.clone()
32299 }
32300}
32301impl MessageData for WINCH_STATUS_DATA {
32302 type Message = MavMessage;
32303 const ID: u32 = 9005u32;
32304 const NAME: &'static str = "WINCH_STATUS";
32305 const EXTRA_CRC: u8 = 117u8;
32306 const ENCODED_LEN: usize = 34usize;
32307 fn deser(
32308 _version: MavlinkVersion,
32309 __input: &[u8],
32310 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32311 let avail_len = __input.len();
32312 let mut payload_buf = [0; Self::ENCODED_LEN];
32313 let mut buf = if avail_len < Self::ENCODED_LEN {
32314 payload_buf[0..avail_len].copy_from_slice(__input);
32315 Bytes::new(&payload_buf)
32316 } else {
32317 Bytes::new(__input)
32318 };
32319 let mut __struct = Self::default();
32320 __struct.time_usec = buf.get_u64_le();
32321 __struct.line_length = buf.get_f32_le();
32322 __struct.speed = buf.get_f32_le();
32323 __struct.tension = buf.get_f32_le();
32324 __struct.voltage = buf.get_f32_le();
32325 __struct.current = buf.get_f32_le();
32326 let tmp = buf.get_u32_le();
32327 __struct.status = MavWinchStatusFlag::from_bits(tmp as <MavWinchStatusFlag as Flags>::Bits)
32328 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32329 flag_type: "MavWinchStatusFlag",
32330 value: tmp as u64,
32331 })?;
32332 __struct.temperature = buf.get_i16_le();
32333 Ok(__struct)
32334 }
32335 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32336 let mut __tmp = BytesMut::new(bytes);
32337 #[allow(clippy::absurd_extreme_comparisons)]
32338 #[allow(unused_comparisons)]
32339 if __tmp.remaining() < Self::ENCODED_LEN {
32340 panic!(
32341 "buffer is too small (need {} bytes, but got {})",
32342 Self::ENCODED_LEN,
32343 __tmp.remaining(),
32344 )
32345 }
32346 __tmp.put_u64_le(self.time_usec);
32347 __tmp.put_f32_le(self.line_length);
32348 __tmp.put_f32_le(self.speed);
32349 __tmp.put_f32_le(self.tension);
32350 __tmp.put_f32_le(self.voltage);
32351 __tmp.put_f32_le(self.current);
32352 __tmp.put_u32_le(self.status.bits() as u32);
32353 __tmp.put_i16_le(self.temperature);
32354 if matches!(version, MavlinkVersion::V2) {
32355 let len = __tmp.len();
32356 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32357 } else {
32358 __tmp.len()
32359 }
32360 }
32361}
32362#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
32363#[doc = ""]
32364#[doc = "ID: 231"]
32365#[derive(Debug, Clone, PartialEq)]
32366#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32368#[cfg_attr(feature = "ts", derive(TS))]
32369#[cfg_attr(feature = "ts", ts(export))]
32370pub struct WIND_COV_DATA {
32371 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32372 pub time_usec: u64,
32373 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
32374 pub wind_x: f32,
32375 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
32376 pub wind_y: f32,
32377 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
32378 pub wind_z: f32,
32379 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32380 pub var_horiz: f32,
32381 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32382 pub var_vert: f32,
32383 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
32384 pub wind_alt: f32,
32385 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
32386 pub horiz_accuracy: f32,
32387 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
32388 pub vert_accuracy: f32,
32389}
32390impl WIND_COV_DATA {
32391 pub const ENCODED_LEN: usize = 40usize;
32392 pub const DEFAULT: Self = Self {
32393 time_usec: 0_u64,
32394 wind_x: 0.0_f32,
32395 wind_y: 0.0_f32,
32396 wind_z: 0.0_f32,
32397 var_horiz: 0.0_f32,
32398 var_vert: 0.0_f32,
32399 wind_alt: 0.0_f32,
32400 horiz_accuracy: 0.0_f32,
32401 vert_accuracy: 0.0_f32,
32402 };
32403 #[cfg(feature = "arbitrary")]
32404 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32405 use arbitrary::{Arbitrary, Unstructured};
32406 let mut buf = [0u8; 1024];
32407 rng.fill_bytes(&mut buf);
32408 let mut unstructured = Unstructured::new(&buf);
32409 Self::arbitrary(&mut unstructured).unwrap_or_default()
32410 }
32411}
32412impl Default for WIND_COV_DATA {
32413 fn default() -> Self {
32414 Self::DEFAULT.clone()
32415 }
32416}
32417impl MessageData for WIND_COV_DATA {
32418 type Message = MavMessage;
32419 const ID: u32 = 231u32;
32420 const NAME: &'static str = "WIND_COV";
32421 const EXTRA_CRC: u8 = 105u8;
32422 const ENCODED_LEN: usize = 40usize;
32423 fn deser(
32424 _version: MavlinkVersion,
32425 __input: &[u8],
32426 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32427 let avail_len = __input.len();
32428 let mut payload_buf = [0; Self::ENCODED_LEN];
32429 let mut buf = if avail_len < Self::ENCODED_LEN {
32430 payload_buf[0..avail_len].copy_from_slice(__input);
32431 Bytes::new(&payload_buf)
32432 } else {
32433 Bytes::new(__input)
32434 };
32435 let mut __struct = Self::default();
32436 __struct.time_usec = buf.get_u64_le();
32437 __struct.wind_x = buf.get_f32_le();
32438 __struct.wind_y = buf.get_f32_le();
32439 __struct.wind_z = buf.get_f32_le();
32440 __struct.var_horiz = buf.get_f32_le();
32441 __struct.var_vert = buf.get_f32_le();
32442 __struct.wind_alt = buf.get_f32_le();
32443 __struct.horiz_accuracy = buf.get_f32_le();
32444 __struct.vert_accuracy = buf.get_f32_le();
32445 Ok(__struct)
32446 }
32447 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32448 let mut __tmp = BytesMut::new(bytes);
32449 #[allow(clippy::absurd_extreme_comparisons)]
32450 #[allow(unused_comparisons)]
32451 if __tmp.remaining() < Self::ENCODED_LEN {
32452 panic!(
32453 "buffer is too small (need {} bytes, but got {})",
32454 Self::ENCODED_LEN,
32455 __tmp.remaining(),
32456 )
32457 }
32458 __tmp.put_u64_le(self.time_usec);
32459 __tmp.put_f32_le(self.wind_x);
32460 __tmp.put_f32_le(self.wind_y);
32461 __tmp.put_f32_le(self.wind_z);
32462 __tmp.put_f32_le(self.var_horiz);
32463 __tmp.put_f32_le(self.var_vert);
32464 __tmp.put_f32_le(self.wind_alt);
32465 __tmp.put_f32_le(self.horiz_accuracy);
32466 __tmp.put_f32_le(self.vert_accuracy);
32467 if matches!(version, MavlinkVersion::V2) {
32468 let len = __tmp.len();
32469 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32470 } else {
32471 __tmp.len()
32472 }
32473 }
32474}
32475#[derive(Clone, PartialEq, Debug)]
32476#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32477#[cfg_attr(feature = "serde", serde(tag = "type"))]
32478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32479#[cfg_attr(feature = "ts", derive(TS))]
32480#[cfg_attr(feature = "ts", ts(export))]
32481#[repr(u32)]
32482pub enum MavMessage {
32483 #[doc = "Set the vehicle attitude and body angular rates."]
32484 #[doc = ""]
32485 #[doc = "ID: 140"]
32486 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
32487 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
32488 #[doc = ""]
32489 #[doc = "ID: 375"]
32490 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
32491 #[doc = "The location and information of an ADSB vehicle."]
32492 #[doc = ""]
32493 #[doc = "ID: 246"]
32494 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
32495 #[doc = "The location and information of an AIS vessel."]
32496 #[doc = ""]
32497 #[doc = "ID: 301"]
32498 AIS_VESSEL(AIS_VESSEL_DATA),
32499 #[doc = "The current system altitude."]
32500 #[doc = ""]
32501 #[doc = "ID: 141"]
32502 ALTITUDE(ALTITUDE_DATA),
32503 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
32504 #[doc = ""]
32505 #[doc = "ID: 30"]
32506 ATTITUDE(ATTITUDE_DATA),
32507 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32508 #[doc = ""]
32509 #[doc = "ID: 31"]
32510 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
32511 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32512 #[doc = ""]
32513 #[doc = "ID: 61"]
32514 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
32515 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
32516 #[doc = ""]
32517 #[doc = "ID: 83"]
32518 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
32519 #[doc = "Motion capture attitude and position."]
32520 #[doc = ""]
32521 #[doc = "ID: 138"]
32522 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
32523 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
32524 #[doc = ""]
32525 #[doc = "ID: 7"]
32526 AUTH_KEY(AUTH_KEY_DATA),
32527 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
32528 #[doc = ""]
32529 #[doc = "ID: 286"]
32530 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
32531 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
32532 #[doc = ""]
32533 #[doc = "ID: 148"]
32534 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
32535 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
32536 #[doc = ""]
32537 #[doc = "ID: 435"]
32538 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
32539 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
32540 #[doc = ""]
32541 #[doc = "ID: 437"]
32542 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
32543 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
32544 #[doc = ""]
32545 #[doc = "ID: 372"]
32546 BATTERY_INFO(BATTERY_INFO_DATA),
32547 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
32548 #[doc = ""]
32549 #[doc = "ID: 147"]
32550 BATTERY_STATUS(BATTERY_STATUS_DATA),
32551 #[doc = "Report button state change."]
32552 #[doc = ""]
32553 #[doc = "ID: 257"]
32554 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
32555 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32556 #[doc = ""]
32557 #[doc = "ID: 262"]
32558 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
32559 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32560 #[doc = ""]
32561 #[doc = "ID: 271"]
32562 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
32563 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
32564 #[doc = ""]
32565 #[doc = "ID: 263"]
32566 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
32567 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32568 #[doc = ""]
32569 #[doc = "ID: 259"]
32570 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
32571 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32572 #[doc = ""]
32573 #[doc = "ID: 260"]
32574 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
32575 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
32576 #[doc = ""]
32577 #[doc = "ID: 277"]
32578 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
32579 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32580 #[doc = ""]
32581 #[doc = "ID: 276"]
32582 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
32583 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32584 #[doc = ""]
32585 #[doc = "ID: 275"]
32586 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
32587 #[doc = "Camera-IMU triggering and synchronisation message."]
32588 #[doc = ""]
32589 #[doc = "ID: 112"]
32590 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
32591 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
32592 #[doc = ""]
32593 #[doc = "ID: 387"]
32594 CANFD_FRAME(CANFD_FRAME_DATA),
32595 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
32596 #[doc = ""]
32597 #[doc = "ID: 388"]
32598 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
32599 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
32600 #[doc = ""]
32601 #[doc = "ID: 386"]
32602 CAN_FRAME(CAN_FRAME_DATA),
32603 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32604 #[doc = ""]
32605 #[doc = "ID: 336"]
32606 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
32607 #[doc = "Report current used cellular network status."]
32608 #[doc = ""]
32609 #[doc = "ID: 334"]
32610 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
32611 #[doc = "Request to control this MAV."]
32612 #[doc = ""]
32613 #[doc = "ID: 5"]
32614 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
32615 #[doc = "Accept / deny control of this MAV."]
32616 #[doc = ""]
32617 #[doc = "ID: 6"]
32618 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
32619 #[doc = "Information about a potential collision."]
32620 #[doc = ""]
32621 #[doc = "ID: 247"]
32622 COLLISION(COLLISION_DATA),
32623 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32624 #[doc = ""]
32625 #[doc = "ID: 77"]
32626 COMMAND_ACK(COMMAND_ACK_DATA),
32627 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32628 #[doc = ""]
32629 #[doc = "ID: 80"]
32630 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
32631 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32632 #[doc = ""]
32633 #[doc = "ID: 75"]
32634 COMMAND_INT(COMMAND_INT_DATA),
32635 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32636 #[doc = ""]
32637 #[doc = "ID: 76"]
32638 COMMAND_LONG(COMMAND_LONG_DATA),
32639 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
32640 #[doc = ""]
32641 #[doc = "ID: 395"]
32642 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
32643 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
32644 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
32645 #[doc = ""]
32646 #[doc = "ID: 396"]
32647 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
32648 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
32649 #[doc = ""]
32650 #[doc = "ID: 397"]
32651 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
32652 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
32653 #[doc = ""]
32654 #[doc = "ID: 146"]
32655 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
32656 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
32657 #[doc = ""]
32658 #[doc = "ID: 411"]
32659 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
32660 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
32661 #[doc = ""]
32662 #[doc = "ID: 436"]
32663 CURRENT_MODE(CURRENT_MODE_DATA),
32664 #[doc = "Data stream status information."]
32665 #[doc = ""]
32666 #[doc = "ID: 67"]
32667 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
32668 DATA_STREAM(DATA_STREAM_DATA),
32669 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
32670 #[doc = ""]
32671 #[doc = "ID: 130"]
32672 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
32673 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
32674 #[doc = ""]
32675 #[doc = "ID: 254"]
32676 DEBUG(DEBUG_DATA),
32677 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
32678 #[doc = ""]
32679 #[doc = "ID: 350"]
32680 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
32681 #[doc = "To debug something using a named 3D vector."]
32682 #[doc = ""]
32683 #[doc = "ID: 250"]
32684 DEBUG_VECT(DEBUG_VECT_DATA),
32685 #[doc = "Distance sensor information for an onboard rangefinder."]
32686 #[doc = ""]
32687 #[doc = "ID: 132"]
32688 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
32689 #[doc = "EFI status output."]
32690 #[doc = ""]
32691 #[doc = "ID: 225"]
32692 EFI_STATUS(EFI_STATUS_DATA),
32693 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
32694 #[doc = ""]
32695 #[doc = "ID: 131"]
32696 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
32697 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
32698 #[doc = ""]
32699 #[doc = "ID: 290"]
32700 ESC_INFO(ESC_INFO_DATA),
32701 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
32702 #[doc = ""]
32703 #[doc = "ID: 291"]
32704 ESC_STATUS(ESC_STATUS_DATA),
32705 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
32706 #[doc = ""]
32707 #[doc = "ID: 230"]
32708 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
32709 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
32710 #[doc = ""]
32711 #[doc = "ID: 410"]
32712 EVENT(EVENT_DATA),
32713 #[doc = "Provides state for additional features."]
32714 #[doc = ""]
32715 #[doc = "ID: 245"]
32716 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
32717 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
32718 #[doc = ""]
32719 #[doc = "ID: 162"]
32720 FENCE_STATUS(FENCE_STATUS_DATA),
32721 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
32722 #[doc = ""]
32723 #[doc = "ID: 110"]
32724 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
32725 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
32726 #[doc = ""]
32727 #[doc = "ID: 264"]
32728 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
32729 #[doc = "Current motion information from a designated system."]
32730 #[doc = ""]
32731 #[doc = "ID: 144"]
32732 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
32733 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
32734 #[doc = ""]
32735 #[doc = "ID: 371"]
32736 FUEL_STATUS(FUEL_STATUS_DATA),
32737 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
32738 #[doc = ""]
32739 #[doc = "ID: 373"]
32740 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
32741 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
32742 #[doc = ""]
32743 #[doc = "ID: 285"]
32744 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
32745 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
32746 #[doc = ""]
32747 #[doc = "ID: 283"]
32748 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
32749 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
32750 #[doc = ""]
32751 #[doc = "ID: 284"]
32752 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
32753 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
32754 #[doc = ""]
32755 #[doc = "ID: 280"]
32756 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
32757 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
32758 #[doc = ""]
32759 #[doc = "ID: 282"]
32760 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
32761 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
32762 #[doc = ""]
32763 #[doc = "ID: 288"]
32764 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
32765 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
32766 #[doc = ""]
32767 #[doc = "ID: 287"]
32768 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
32769 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
32770 #[doc = ""]
32771 #[doc = "ID: 281"]
32772 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
32773 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
32774 #[doc = ""]
32775 #[doc = "ID: 33"]
32776 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
32777 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
32778 #[doc = ""]
32779 #[doc = "ID: 63"]
32780 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
32781 #[doc = "Global position/attitude estimate from a vision source."]
32782 #[doc = ""]
32783 #[doc = "ID: 101"]
32784 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
32785 #[doc = "Second GPS data."]
32786 #[doc = ""]
32787 #[doc = "ID: 124"]
32788 GPS2_RAW(GPS2_RAW_DATA),
32789 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32790 #[doc = ""]
32791 #[doc = "ID: 128"]
32792 GPS2_RTK(GPS2_RTK_DATA),
32793 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
32794 #[doc = ""]
32795 #[doc = "ID: 49"]
32796 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
32797 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
32798 #[doc = ""]
32799 #[doc = "ID: 123"]
32800 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
32801 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
32802 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
32803 #[doc = ""]
32804 #[doc = "ID: 232"]
32805 GPS_INPUT(GPS_INPUT_DATA),
32806 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32807 #[doc = ""]
32808 #[doc = "ID: 24"]
32809 GPS_RAW_INT(GPS_RAW_INT_DATA),
32810 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
32811 #[doc = ""]
32812 #[doc = "ID: 233"]
32813 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
32814 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32815 #[doc = ""]
32816 #[doc = "ID: 127"]
32817 GPS_RTK(GPS_RTK_DATA),
32818 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
32819 #[doc = ""]
32820 #[doc = "ID: 25"]
32821 GPS_STATUS(GPS_STATUS_DATA),
32822 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
32823 #[doc = ""]
32824 #[doc = "ID: 0"]
32825 HEARTBEAT(HEARTBEAT_DATA),
32826 #[doc = "The IMU readings in SI units in NED body frame."]
32827 #[doc = ""]
32828 #[doc = "ID: 105"]
32829 HIGHRES_IMU(HIGHRES_IMU_DATA),
32830 #[doc = "Message appropriate for high latency connections like Iridium."]
32831 #[doc = ""]
32832 #[doc = "ID: 234"]
32833 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
32834 HIGH_LATENCY(HIGH_LATENCY_DATA),
32835 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
32836 #[doc = ""]
32837 #[doc = "ID: 235"]
32838 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
32839 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
32840 #[doc = ""]
32841 #[doc = "ID: 93"]
32842 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
32843 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
32844 #[doc = ""]
32845 #[doc = "ID: 91"]
32846 HIL_CONTROLS(HIL_CONTROLS_DATA),
32847 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32848 #[doc = ""]
32849 #[doc = "ID: 113"]
32850 HIL_GPS(HIL_GPS_DATA),
32851 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
32852 #[doc = ""]
32853 #[doc = "ID: 114"]
32854 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
32855 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
32856 #[doc = ""]
32857 #[doc = "ID: 92"]
32858 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
32859 #[doc = "The IMU readings in SI units in NED body frame."]
32860 #[doc = ""]
32861 #[doc = "ID: 107"]
32862 HIL_SENSOR(HIL_SENSOR_DATA),
32863 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32864 #[doc = ""]
32865 #[doc = "ID: 90"]
32866 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
32867 HIL_STATE(HIL_STATE_DATA),
32868 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32869 #[doc = ""]
32870 #[doc = "ID: 115"]
32871 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
32872 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
32873 #[doc = ""]
32874 #[doc = "ID: 242"]
32875 HOME_POSITION(HOME_POSITION_DATA),
32876 #[doc = "Temperature and humidity from hygrometer."]
32877 #[doc = ""]
32878 #[doc = "ID: 12920"]
32879 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
32880 #[doc = "Illuminator status."]
32881 #[doc = ""]
32882 #[doc = "ID: 440"]
32883 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
32884 #[doc = "Status of the Iridium SBD link."]
32885 #[doc = ""]
32886 #[doc = "ID: 335"]
32887 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
32888 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
32889 #[doc = ""]
32890 #[doc = "ID: 149"]
32891 LANDING_TARGET(LANDING_TARGET_DATA),
32892 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
32893 #[doc = ""]
32894 #[doc = "ID: 8"]
32895 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
32896 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32897 #[doc = ""]
32898 #[doc = "ID: 32"]
32899 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
32900 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32901 #[doc = ""]
32902 #[doc = "ID: 64"]
32903 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
32904 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32905 #[doc = ""]
32906 #[doc = "ID: 89"]
32907 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
32908 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
32909 #[doc = ""]
32910 #[doc = "ID: 268"]
32911 LOGGING_ACK(LOGGING_ACK_DATA),
32912 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
32913 #[doc = ""]
32914 #[doc = "ID: 266"]
32915 LOGGING_DATA(LOGGING_DATA_DATA),
32916 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
32917 #[doc = ""]
32918 #[doc = "ID: 267"]
32919 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
32920 #[doc = "Reply to LOG_REQUEST_DATA."]
32921 #[doc = ""]
32922 #[doc = "ID: 120"]
32923 LOG_DATA(LOG_DATA_DATA),
32924 #[doc = "Reply to LOG_REQUEST_LIST."]
32925 #[doc = ""]
32926 #[doc = "ID: 118"]
32927 LOG_ENTRY(LOG_ENTRY_DATA),
32928 #[doc = "Erase all logs."]
32929 #[doc = ""]
32930 #[doc = "ID: 121"]
32931 LOG_ERASE(LOG_ERASE_DATA),
32932 #[doc = "Request a chunk of a log."]
32933 #[doc = ""]
32934 #[doc = "ID: 119"]
32935 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
32936 #[doc = "Stop log transfer and resume normal logging."]
32937 #[doc = ""]
32938 #[doc = "ID: 122"]
32939 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
32940 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
32941 #[doc = ""]
32942 #[doc = "ID: 117"]
32943 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
32944 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
32945 #[doc = ""]
32946 #[doc = "ID: 192"]
32947 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
32948 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
32949 #[doc = ""]
32950 #[doc = "ID: 69"]
32951 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
32952 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
32953 #[doc = ""]
32954 #[doc = "ID: 81"]
32955 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
32956 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32957 #[doc = ""]
32958 #[doc = "ID: 249"]
32959 MEMORY_VECT(MEMORY_VECT_DATA),
32960 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
32961 #[doc = ""]
32962 #[doc = "ID: 244"]
32963 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
32964 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
32965 #[doc = ""]
32966 #[doc = "ID: 47"]
32967 MISSION_ACK(MISSION_ACK_DATA),
32968 #[doc = "Delete all mission items at once."]
32969 #[doc = ""]
32970 #[doc = "ID: 45"]
32971 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
32972 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
32973 #[doc = ""]
32974 #[doc = "ID: 44"]
32975 MISSION_COUNT(MISSION_COUNT_DATA),
32976 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
32977 #[doc = ""]
32978 #[doc = "ID: 42"]
32979 MISSION_CURRENT(MISSION_CURRENT_DATA),
32980 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
32981 #[doc = ""]
32982 #[doc = "ID: 39"]
32983 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
32984 MISSION_ITEM(MISSION_ITEM_DATA),
32985 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
32986 #[doc = ""]
32987 #[doc = "ID: 73"]
32988 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
32989 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
32990 #[doc = ""]
32991 #[doc = "ID: 46"]
32992 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
32993 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
32994 #[doc = ""]
32995 #[doc = "ID: 40"]
32996 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
32997 MISSION_REQUEST(MISSION_REQUEST_DATA),
32998 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
32999 #[doc = ""]
33000 #[doc = "ID: 51"]
33001 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
33002 #[doc = "Request the overall list of mission items from the system/component."]
33003 #[doc = ""]
33004 #[doc = "ID: 43"]
33005 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
33006 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
33007 #[doc = ""]
33008 #[doc = "ID: 37"]
33009 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
33010 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
33011 #[doc = ""]
33012 #[doc = "ID: 41"]
33013 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
33014 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
33015 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
33016 #[doc = ""]
33017 #[doc = "ID: 38"]
33018 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
33019 #[doc = "Orientation of a mount."]
33020 #[doc = ""]
33021 #[doc = "ID: 265"]
33022 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
33023 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
33024 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33025 #[doc = ""]
33026 #[doc = "ID: 251"]
33027 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
33028 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33029 #[doc = ""]
33030 #[doc = "ID: 252"]
33031 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
33032 #[doc = "The state of the navigation and position controller."]
33033 #[doc = ""]
33034 #[doc = "ID: 62"]
33035 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
33036 #[doc = "Accelerometer and Gyro biases from the navigation filter."]
33037 #[doc = ""]
33038 #[doc = "ID: 220"]
33039 NAV_FILTER_BIAS(NAV_FILTER_BIAS_DATA),
33040 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
33041 #[doc = ""]
33042 #[doc = "ID: 330"]
33043 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
33044 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
33045 #[doc = ""]
33046 #[doc = "ID: 331"]
33047 ODOMETRY(ODOMETRY_DATA),
33048 #[doc = "Hardware status sent by an onboard computer."]
33049 #[doc = ""]
33050 #[doc = "ID: 390"]
33051 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
33052 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
33053 #[doc = ""]
33054 #[doc = "ID: 12918"]
33055 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
33056 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
33057 #[doc = ""]
33058 #[doc = "ID: 12902"]
33059 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
33060 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
33061 #[doc = ""]
33062 #[doc = "ID: 12900"]
33063 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
33064 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
33065 #[doc = ""]
33066 #[doc = "ID: 12901"]
33067 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
33068 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
33069 #[doc = ""]
33070 #[doc = "ID: 12915"]
33071 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
33072 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
33073 #[doc = ""]
33074 #[doc = "ID: 12905"]
33075 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
33076 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
33077 #[doc = ""]
33078 #[doc = "ID: 12903"]
33079 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
33080 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
33081 #[doc = ""]
33082 #[doc = "ID: 12904"]
33083 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
33084 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
33085 #[doc = ""]
33086 #[doc = "ID: 12919"]
33087 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
33088 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
33089 #[doc = ""]
33090 #[doc = "ID: 100"]
33091 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
33092 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
33093 #[doc = ""]
33094 #[doc = "ID: 106"]
33095 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
33096 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
33097 #[doc = ""]
33098 #[doc = "ID: 360"]
33099 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
33100 #[doc = "Response from a PARAM_EXT_SET message."]
33101 #[doc = ""]
33102 #[doc = "ID: 324"]
33103 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
33104 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
33105 #[doc = ""]
33106 #[doc = "ID: 321"]
33107 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
33108 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
33109 #[doc = ""]
33110 #[doc = "ID: 320"]
33111 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
33112 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
33113 #[doc = ""]
33114 #[doc = "ID: 323"]
33115 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
33116 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
33117 #[doc = ""]
33118 #[doc = "ID: 322"]
33119 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
33120 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
33121 #[doc = ""]
33122 #[doc = "ID: 50"]
33123 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
33124 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33125 #[doc = ""]
33126 #[doc = "ID: 21"]
33127 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
33128 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
33129 #[doc = ""]
33130 #[doc = "ID: 20"]
33131 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
33132 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33133 #[doc = ""]
33134 #[doc = "ID: 23"]
33135 PARAM_SET(PARAM_SET_DATA),
33136 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33137 #[doc = ""]
33138 #[doc = "ID: 22"]
33139 PARAM_VALUE(PARAM_VALUE_DATA),
33140 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
33141 #[doc = ""]
33142 #[doc = "ID: 4"]
33143 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
33144 PING(PING_DATA),
33145 #[doc = "Control vehicle tone generation (buzzer)."]
33146 #[doc = ""]
33147 #[doc = "ID: 258"]
33148 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
33149 PLAY_TUNE(PLAY_TUNE_DATA),
33150 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
33151 #[doc = ""]
33152 #[doc = "ID: 400"]
33153 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
33154 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
33155 #[doc = ""]
33156 #[doc = "ID: 87"]
33157 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
33158 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
33159 #[doc = ""]
33160 #[doc = "ID: 85"]
33161 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
33162 #[doc = "Power supply status."]
33163 #[doc = ""]
33164 #[doc = "ID: 125"]
33165 POWER_STATUS(POWER_STATUS_DATA),
33166 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
33167 #[doc = ""]
33168 #[doc = "ID: 300"]
33169 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
33170 #[doc = "Complete set of calibration parameters for the radio."]
33171 #[doc = ""]
33172 #[doc = "ID: 221"]
33173 RADIO_CALIBRATION(RADIO_CALIBRATION_DATA),
33174 #[doc = "Status generated by radio and injected into MAVLink stream."]
33175 #[doc = ""]
33176 #[doc = "ID: 109"]
33177 RADIO_STATUS(RADIO_STATUS_DATA),
33178 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
33179 #[doc = ""]
33180 #[doc = "ID: 27"]
33181 RAW_IMU(RAW_IMU_DATA),
33182 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
33183 #[doc = ""]
33184 #[doc = "ID: 28"]
33185 RAW_PRESSURE(RAW_PRESSURE_DATA),
33186 #[doc = "RPM sensor data message."]
33187 #[doc = ""]
33188 #[doc = "ID: 339"]
33189 RAW_RPM(RAW_RPM_DATA),
33190 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33191 #[doc = ""]
33192 #[doc = "ID: 65"]
33193 RC_CHANNELS(RC_CHANNELS_DATA),
33194 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
33195 #[doc = ""]
33196 #[doc = "ID: 70"]
33197 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
33198 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33199 #[doc = ""]
33200 #[doc = "ID: 35"]
33201 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
33202 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
33203 #[doc = ""]
33204 #[doc = "ID: 34"]
33205 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
33206 #[doc = "Request a data stream."]
33207 #[doc = ""]
33208 #[doc = "ID: 66"]
33209 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
33210 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
33211 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
33212 #[doc = ""]
33213 #[doc = "ID: 412"]
33214 REQUEST_EVENT(REQUEST_EVENT_DATA),
33215 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
33216 #[doc = ""]
33217 #[doc = "ID: 142"]
33218 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
33219 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
33220 #[doc = ""]
33221 #[doc = "ID: 413"]
33222 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
33223 #[doc = "Read out the safety zone the MAV currently assumes."]
33224 #[doc = ""]
33225 #[doc = "ID: 55"]
33226 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
33227 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
33228 #[doc = ""]
33229 #[doc = "ID: 54"]
33230 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
33231 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
33232 #[doc = ""]
33233 #[doc = "ID: 26"]
33234 SCALED_IMU(SCALED_IMU_DATA),
33235 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
33236 #[doc = ""]
33237 #[doc = "ID: 116"]
33238 SCALED_IMU2(SCALED_IMU2_DATA),
33239 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
33240 #[doc = ""]
33241 #[doc = "ID: 129"]
33242 SCALED_IMU3(SCALED_IMU3_DATA),
33243 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
33244 #[doc = ""]
33245 #[doc = "ID: 29"]
33246 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
33247 #[doc = "Barometer readings for 2nd barometer."]
33248 #[doc = ""]
33249 #[doc = "ID: 137"]
33250 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
33251 #[doc = "Barometer readings for 3rd barometer."]
33252 #[doc = ""]
33253 #[doc = "ID: 143"]
33254 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
33255 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
33256 #[doc = ""]
33257 #[doc = "ID: 126"]
33258 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
33259 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
33260 #[doc = ""]
33261 #[doc = "ID: 36"]
33262 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
33263 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
33264 #[doc = ""]
33265 #[doc = "ID: 256"]
33266 SETUP_SIGNING(SETUP_SIGNING_DATA),
33267 #[doc = "Set the vehicle attitude and body angular rates."]
33268 #[doc = ""]
33269 #[doc = "ID: 139"]
33270 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
33271 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
33272 #[doc = ""]
33273 #[doc = "ID: 82"]
33274 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
33275 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
33276 #[doc = ""]
33277 #[doc = "ID: 48"]
33278 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
33279 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
33280 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
33281 #[doc = ""]
33282 #[doc = "ID: 243"]
33283 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
33284 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
33285 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
33286 #[doc = ""]
33287 #[doc = "ID: 11"]
33288 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
33289 SET_MODE(SET_MODE_DATA),
33290 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
33291 #[doc = ""]
33292 #[doc = "ID: 86"]
33293 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
33294 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
33295 #[doc = ""]
33296 #[doc = "ID: 84"]
33297 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
33298 #[doc = "Status of simulation environment, if used."]
33299 #[doc = ""]
33300 #[doc = "ID: 108"]
33301 SIM_STATE(SIM_STATE_DATA),
33302 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
33303 #[doc = ""]
33304 #[doc = "ID: 370"]
33305 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
33306 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
33307 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
33308 #[doc = ""]
33309 #[doc = "ID: 253"]
33310 STATUSTEXT(STATUSTEXT_DATA),
33311 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
33312 #[doc = ""]
33313 #[doc = "ID: 261"]
33314 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
33315 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
33316 #[doc = ""]
33317 #[doc = "ID: 401"]
33318 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
33319 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
33320 #[doc = ""]
33321 #[doc = "ID: 2"]
33322 SYSTEM_TIME(SYSTEM_TIME_DATA),
33323 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
33324 #[doc = ""]
33325 #[doc = "ID: 1"]
33326 SYS_STATUS(SYS_STATUS_DATA),
33327 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
33328 #[doc = ""]
33329 #[doc = "ID: 135"]
33330 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
33331 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33332 #[doc = ""]
33333 #[doc = "ID: 134"]
33334 TERRAIN_DATA(TERRAIN_DATA_DATA),
33335 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33336 #[doc = ""]
33337 #[doc = "ID: 136"]
33338 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
33339 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33340 #[doc = ""]
33341 #[doc = "ID: 133"]
33342 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
33343 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
33344 #[doc = ""]
33345 #[doc = "ID: 111"]
33346 TIMESYNC(TIMESYNC_DATA),
33347 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
33348 #[doc = ""]
33349 #[doc = "ID: 380"]
33350 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
33351 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
33352 #[doc = ""]
33353 #[doc = "ID: 333"]
33354 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
33355 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
33356 #[doc = ""]
33357 #[doc = "ID: 332"]
33358 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
33359 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
33360 #[doc = ""]
33361 #[doc = "ID: 385"]
33362 TUNNEL(TUNNEL_DATA),
33363 #[doc = "System status specific to ualberta uav."]
33364 #[doc = ""]
33365 #[doc = "ID: 222"]
33366 UALBERTA_SYS_STATUS(UALBERTA_SYS_STATUS_DATA),
33367 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
33368 #[doc = ""]
33369 #[doc = "ID: 311"]
33370 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
33371 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
33372 #[doc = ""]
33373 #[doc = "ID: 310"]
33374 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
33375 #[doc = "The global position resulting from GPS and sensor fusion."]
33376 #[doc = ""]
33377 #[doc = "ID: 340"]
33378 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
33379 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
33380 #[doc = ""]
33381 #[doc = "ID: 248"]
33382 V2_EXTENSION(V2_EXTENSION_DATA),
33383 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
33384 #[doc = ""]
33385 #[doc = "ID: 74"]
33386 VFR_HUD(VFR_HUD_DATA),
33387 #[doc = "Vibration levels and accelerometer clipping."]
33388 #[doc = ""]
33389 #[doc = "ID: 241"]
33390 VIBRATION(VIBRATION_DATA),
33391 #[doc = "Global position estimate from a Vicon motion system source."]
33392 #[doc = ""]
33393 #[doc = "ID: 104"]
33394 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
33395 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
33396 #[doc = ""]
33397 #[doc = "ID: 269"]
33398 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
33399 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
33400 #[doc = ""]
33401 #[doc = "ID: 270"]
33402 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
33403 #[doc = "Local position/attitude estimate from a vision source."]
33404 #[doc = ""]
33405 #[doc = "ID: 102"]
33406 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
33407 #[doc = "Speed estimate from a vision source."]
33408 #[doc = ""]
33409 #[doc = "ID: 103"]
33410 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
33411 #[doc = "Cumulative distance traveled for each reported wheel."]
33412 #[doc = ""]
33413 #[doc = "ID: 9000"]
33414 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
33415 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33416 #[doc = ""]
33417 #[doc = "ID: 299"]
33418 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
33419 #[doc = "Winch status."]
33420 #[doc = ""]
33421 #[doc = "ID: 9005"]
33422 WINCH_STATUS(WINCH_STATUS_DATA),
33423 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
33424 #[doc = ""]
33425 #[doc = "ID: 231"]
33426 WIND_COV(WIND_COV_DATA),
33427}
33428impl MavMessage {
33429 pub const fn all_ids() -> &'static [u32] {
33430 &[
33431 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
33432 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
33433 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
33434 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
33435 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
33436 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
33437 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
33438 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
33439 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
33440 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
33441 148u32, 149u32, 162u32, 192u32, 220u32, 221u32, 222u32, 225u32, 230u32, 231u32, 232u32,
33442 233u32, 234u32, 235u32, 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32,
33443 249u32, 250u32, 251u32, 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32,
33444 261u32, 262u32, 263u32, 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32,
33445 275u32, 276u32, 277u32, 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32,
33446 288u32, 290u32, 291u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32,
33447 323u32, 324u32, 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32,
33448 350u32, 360u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32,
33449 388u32, 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32,
33450 435u32, 436u32, 437u32, 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32,
33451 12903u32, 12904u32, 12905u32, 12915u32, 12918u32, 12919u32, 12920u32,
33452 ]
33453 }
33454}
33455impl Message for MavMessage {
33456 fn parse(
33457 version: MavlinkVersion,
33458 id: u32,
33459 payload: &[u8],
33460 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33461 match id {
33462 ACTUATOR_CONTROL_TARGET_DATA::ID => {
33463 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33464 .map(Self::ACTUATOR_CONTROL_TARGET)
33465 }
33466 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
33467 .map(Self::ACTUATOR_OUTPUT_STATUS),
33468 ADSB_VEHICLE_DATA::ID => {
33469 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
33470 }
33471 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
33472 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
33473 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
33474 ATTITUDE_QUATERNION_DATA::ID => {
33475 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
33476 }
33477 ATTITUDE_QUATERNION_COV_DATA::ID => {
33478 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
33479 .map(Self::ATTITUDE_QUATERNION_COV)
33480 }
33481 ATTITUDE_TARGET_DATA::ID => {
33482 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
33483 }
33484 ATT_POS_MOCAP_DATA::ID => {
33485 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
33486 }
33487 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
33488 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33489 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
33490 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
33491 }
33492 AUTOPILOT_VERSION_DATA::ID => {
33493 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
33494 }
33495 AVAILABLE_MODES_DATA::ID => {
33496 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
33497 }
33498 AVAILABLE_MODES_MONITOR_DATA::ID => {
33499 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
33500 .map(Self::AVAILABLE_MODES_MONITOR)
33501 }
33502 BATTERY_INFO_DATA::ID => {
33503 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
33504 }
33505 BATTERY_STATUS_DATA::ID => {
33506 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
33507 }
33508 BUTTON_CHANGE_DATA::ID => {
33509 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
33510 }
33511 CAMERA_CAPTURE_STATUS_DATA::ID => {
33512 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
33513 }
33514 CAMERA_FOV_STATUS_DATA::ID => {
33515 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
33516 }
33517 CAMERA_IMAGE_CAPTURED_DATA::ID => {
33518 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
33519 }
33520 CAMERA_INFORMATION_DATA::ID => {
33521 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
33522 }
33523 CAMERA_SETTINGS_DATA::ID => {
33524 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
33525 }
33526 CAMERA_THERMAL_RANGE_DATA::ID => {
33527 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
33528 }
33529 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
33530 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
33531 .map(Self::CAMERA_TRACKING_GEO_STATUS)
33532 }
33533 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
33534 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
33535 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
33536 }
33537 CAMERA_TRIGGER_DATA::ID => {
33538 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
33539 }
33540 CANFD_FRAME_DATA::ID => {
33541 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
33542 }
33543 CAN_FILTER_MODIFY_DATA::ID => {
33544 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
33545 }
33546 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
33547 CELLULAR_CONFIG_DATA::ID => {
33548 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
33549 }
33550 CELLULAR_STATUS_DATA::ID => {
33551 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
33552 }
33553 CHANGE_OPERATOR_CONTROL_DATA::ID => {
33554 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
33555 .map(Self::CHANGE_OPERATOR_CONTROL)
33556 }
33557 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
33558 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
33559 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
33560 }
33561 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
33562 COMMAND_ACK_DATA::ID => {
33563 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
33564 }
33565 COMMAND_CANCEL_DATA::ID => {
33566 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
33567 }
33568 COMMAND_INT_DATA::ID => {
33569 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
33570 }
33571 COMMAND_LONG_DATA::ID => {
33572 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
33573 }
33574 COMPONENT_INFORMATION_DATA::ID => {
33575 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
33576 }
33577 COMPONENT_INFORMATION_BASIC_DATA::ID => {
33578 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
33579 .map(Self::COMPONENT_INFORMATION_BASIC)
33580 }
33581 COMPONENT_METADATA_DATA::ID => {
33582 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
33583 }
33584 CONTROL_SYSTEM_STATE_DATA::ID => {
33585 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
33586 }
33587 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
33588 .map(Self::CURRENT_EVENT_SEQUENCE),
33589 CURRENT_MODE_DATA::ID => {
33590 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
33591 }
33592 DATA_STREAM_DATA::ID => {
33593 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
33594 }
33595 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
33596 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
33597 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
33598 }
33599 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
33600 DEBUG_FLOAT_ARRAY_DATA::ID => {
33601 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
33602 }
33603 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
33604 DISTANCE_SENSOR_DATA::ID => {
33605 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
33606 }
33607 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
33608 ENCAPSULATED_DATA_DATA::ID => {
33609 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
33610 }
33611 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
33612 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
33613 ESTIMATOR_STATUS_DATA::ID => {
33614 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
33615 }
33616 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
33617 EXTENDED_SYS_STATE_DATA::ID => {
33618 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
33619 }
33620 FENCE_STATUS_DATA::ID => {
33621 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
33622 }
33623 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
33624 .map(Self::FILE_TRANSFER_PROTOCOL),
33625 FLIGHT_INFORMATION_DATA::ID => {
33626 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
33627 }
33628 FOLLOW_TARGET_DATA::ID => {
33629 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
33630 }
33631 FUEL_STATUS_DATA::ID => {
33632 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
33633 }
33634 GENERATOR_STATUS_DATA::ID => {
33635 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
33636 }
33637 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
33638 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
33639 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
33640 }
33641 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
33642 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
33643 .map(Self::GIMBAL_DEVICE_INFORMATION)
33644 }
33645 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
33646 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
33647 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
33648 }
33649 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
33650 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
33651 .map(Self::GIMBAL_MANAGER_INFORMATION)
33652 }
33653 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
33654 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
33655 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
33656 }
33657 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33658 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
33659 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
33660 }
33661 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
33662 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
33663 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
33664 }
33665 GIMBAL_MANAGER_STATUS_DATA::ID => {
33666 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
33667 }
33668 GLOBAL_POSITION_INT_DATA::ID => {
33669 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
33670 }
33671 GLOBAL_POSITION_INT_COV_DATA::ID => {
33672 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
33673 .map(Self::GLOBAL_POSITION_INT_COV)
33674 }
33675 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33676 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33677 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
33678 }
33679 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
33680 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
33681 GPS_GLOBAL_ORIGIN_DATA::ID => {
33682 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
33683 }
33684 GPS_INJECT_DATA_DATA::ID => {
33685 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
33686 }
33687 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
33688 GPS_RAW_INT_DATA::ID => {
33689 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
33690 }
33691 GPS_RTCM_DATA_DATA::ID => {
33692 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
33693 }
33694 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
33695 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
33696 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
33697 HIGHRES_IMU_DATA::ID => {
33698 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
33699 }
33700 HIGH_LATENCY_DATA::ID => {
33701 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
33702 }
33703 HIGH_LATENCY2_DATA::ID => {
33704 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
33705 }
33706 HIL_ACTUATOR_CONTROLS_DATA::ID => {
33707 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
33708 }
33709 HIL_CONTROLS_DATA::ID => {
33710 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
33711 }
33712 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
33713 HIL_OPTICAL_FLOW_DATA::ID => {
33714 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
33715 }
33716 HIL_RC_INPUTS_RAW_DATA::ID => {
33717 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
33718 }
33719 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
33720 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
33721 HIL_STATE_QUATERNION_DATA::ID => {
33722 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
33723 }
33724 HOME_POSITION_DATA::ID => {
33725 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
33726 }
33727 HYGROMETER_SENSOR_DATA::ID => {
33728 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
33729 }
33730 ILLUMINATOR_STATUS_DATA::ID => {
33731 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
33732 }
33733 ISBD_LINK_STATUS_DATA::ID => {
33734 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
33735 }
33736 LANDING_TARGET_DATA::ID => {
33737 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
33738 }
33739 LINK_NODE_STATUS_DATA::ID => {
33740 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
33741 }
33742 LOCAL_POSITION_NED_DATA::ID => {
33743 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
33744 }
33745 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
33746 .map(Self::LOCAL_POSITION_NED_COV),
33747 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33748 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
33749 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
33750 }
33751 LOGGING_ACK_DATA::ID => {
33752 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
33753 }
33754 LOGGING_DATA_DATA::ID => {
33755 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
33756 }
33757 LOGGING_DATA_ACKED_DATA::ID => {
33758 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
33759 }
33760 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
33761 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
33762 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
33763 LOG_REQUEST_DATA_DATA::ID => {
33764 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
33765 }
33766 LOG_REQUEST_END_DATA::ID => {
33767 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
33768 }
33769 LOG_REQUEST_LIST_DATA::ID => {
33770 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
33771 }
33772 MAG_CAL_REPORT_DATA::ID => {
33773 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
33774 }
33775 MANUAL_CONTROL_DATA::ID => {
33776 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
33777 }
33778 MANUAL_SETPOINT_DATA::ID => {
33779 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
33780 }
33781 MEMORY_VECT_DATA::ID => {
33782 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
33783 }
33784 MESSAGE_INTERVAL_DATA::ID => {
33785 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
33786 }
33787 MISSION_ACK_DATA::ID => {
33788 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
33789 }
33790 MISSION_CLEAR_ALL_DATA::ID => {
33791 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
33792 }
33793 MISSION_COUNT_DATA::ID => {
33794 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
33795 }
33796 MISSION_CURRENT_DATA::ID => {
33797 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
33798 }
33799 MISSION_ITEM_DATA::ID => {
33800 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
33801 }
33802 MISSION_ITEM_INT_DATA::ID => {
33803 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
33804 }
33805 MISSION_ITEM_REACHED_DATA::ID => {
33806 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
33807 }
33808 MISSION_REQUEST_DATA::ID => {
33809 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
33810 }
33811 MISSION_REQUEST_INT_DATA::ID => {
33812 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
33813 }
33814 MISSION_REQUEST_LIST_DATA::ID => {
33815 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
33816 }
33817 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
33818 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
33819 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
33820 }
33821 MISSION_SET_CURRENT_DATA::ID => {
33822 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
33823 }
33824 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
33825 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
33826 .map(Self::MISSION_WRITE_PARTIAL_LIST)
33827 }
33828 MOUNT_ORIENTATION_DATA::ID => {
33829 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
33830 }
33831 NAMED_VALUE_FLOAT_DATA::ID => {
33832 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
33833 }
33834 NAMED_VALUE_INT_DATA::ID => {
33835 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
33836 }
33837 NAV_CONTROLLER_OUTPUT_DATA::ID => {
33838 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
33839 }
33840 NAV_FILTER_BIAS_DATA::ID => {
33841 NAV_FILTER_BIAS_DATA::deser(version, payload).map(Self::NAV_FILTER_BIAS)
33842 }
33843 OBSTACLE_DISTANCE_DATA::ID => {
33844 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
33845 }
33846 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
33847 ONBOARD_COMPUTER_STATUS_DATA::ID => {
33848 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
33849 .map(Self::ONBOARD_COMPUTER_STATUS)
33850 }
33851 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
33852 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
33853 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
33854 }
33855 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
33856 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
33857 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
33858 }
33859 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
33860 .map(Self::OPEN_DRONE_ID_BASIC_ID),
33861 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
33862 .map(Self::OPEN_DRONE_ID_LOCATION),
33863 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
33864 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
33865 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
33866 }
33867 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
33868 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
33869 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
33870 }
33871 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
33872 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
33873 }
33874 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
33875 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
33876 }
33877 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
33878 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
33879 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
33880 }
33881 OPTICAL_FLOW_DATA::ID => {
33882 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
33883 }
33884 OPTICAL_FLOW_RAD_DATA::ID => {
33885 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
33886 }
33887 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
33888 .map(Self::ORBIT_EXECUTION_STATUS),
33889 PARAM_EXT_ACK_DATA::ID => {
33890 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
33891 }
33892 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
33893 .map(Self::PARAM_EXT_REQUEST_LIST),
33894 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
33895 .map(Self::PARAM_EXT_REQUEST_READ),
33896 PARAM_EXT_SET_DATA::ID => {
33897 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
33898 }
33899 PARAM_EXT_VALUE_DATA::ID => {
33900 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
33901 }
33902 PARAM_MAP_RC_DATA::ID => {
33903 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
33904 }
33905 PARAM_REQUEST_LIST_DATA::ID => {
33906 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
33907 }
33908 PARAM_REQUEST_READ_DATA::ID => {
33909 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
33910 }
33911 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
33912 PARAM_VALUE_DATA::ID => {
33913 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
33914 }
33915 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
33916 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
33917 PLAY_TUNE_V2_DATA::ID => {
33918 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
33919 }
33920 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33921 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33922 .map(Self::POSITION_TARGET_GLOBAL_INT)
33923 }
33924 POSITION_TARGET_LOCAL_NED_DATA::ID => {
33925 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33926 .map(Self::POSITION_TARGET_LOCAL_NED)
33927 }
33928 POWER_STATUS_DATA::ID => {
33929 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
33930 }
33931 PROTOCOL_VERSION_DATA::ID => {
33932 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
33933 }
33934 RADIO_CALIBRATION_DATA::ID => {
33935 RADIO_CALIBRATION_DATA::deser(version, payload).map(Self::RADIO_CALIBRATION)
33936 }
33937 RADIO_STATUS_DATA::ID => {
33938 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
33939 }
33940 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
33941 RAW_PRESSURE_DATA::ID => {
33942 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
33943 }
33944 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
33945 RC_CHANNELS_DATA::ID => {
33946 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
33947 }
33948 RC_CHANNELS_OVERRIDE_DATA::ID => {
33949 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
33950 }
33951 RC_CHANNELS_RAW_DATA::ID => {
33952 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
33953 }
33954 RC_CHANNELS_SCALED_DATA::ID => {
33955 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
33956 }
33957 REQUEST_DATA_STREAM_DATA::ID => {
33958 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
33959 }
33960 REQUEST_EVENT_DATA::ID => {
33961 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
33962 }
33963 RESOURCE_REQUEST_DATA::ID => {
33964 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
33965 }
33966 RESPONSE_EVENT_ERROR_DATA::ID => {
33967 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
33968 }
33969 SAFETY_ALLOWED_AREA_DATA::ID => {
33970 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
33971 }
33972 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
33973 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
33974 .map(Self::SAFETY_SET_ALLOWED_AREA)
33975 }
33976 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
33977 SCALED_IMU2_DATA::ID => {
33978 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
33979 }
33980 SCALED_IMU3_DATA::ID => {
33981 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
33982 }
33983 SCALED_PRESSURE_DATA::ID => {
33984 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
33985 }
33986 SCALED_PRESSURE2_DATA::ID => {
33987 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
33988 }
33989 SCALED_PRESSURE3_DATA::ID => {
33990 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
33991 }
33992 SERIAL_CONTROL_DATA::ID => {
33993 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
33994 }
33995 SERVO_OUTPUT_RAW_DATA::ID => {
33996 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
33997 }
33998 SETUP_SIGNING_DATA::ID => {
33999 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
34000 }
34001 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
34002 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
34003 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
34004 }
34005 SET_ATTITUDE_TARGET_DATA::ID => {
34006 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
34007 }
34008 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
34009 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
34010 }
34011 SET_HOME_POSITION_DATA::ID => {
34012 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
34013 }
34014 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
34015 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34016 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
34017 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
34018 }
34019 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
34020 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
34021 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
34022 }
34023 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
34024 SMART_BATTERY_INFO_DATA::ID => {
34025 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
34026 }
34027 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
34028 STORAGE_INFORMATION_DATA::ID => {
34029 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
34030 }
34031 SUPPORTED_TUNES_DATA::ID => {
34032 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
34033 }
34034 SYSTEM_TIME_DATA::ID => {
34035 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
34036 }
34037 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
34038 TERRAIN_CHECK_DATA::ID => {
34039 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
34040 }
34041 TERRAIN_DATA_DATA::ID => {
34042 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
34043 }
34044 TERRAIN_REPORT_DATA::ID => {
34045 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
34046 }
34047 TERRAIN_REQUEST_DATA::ID => {
34048 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
34049 }
34050 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
34051 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
34052 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
34053 .map(Self::TIME_ESTIMATE_TO_TARGET)
34054 }
34055 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34056 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
34057 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
34058 }
34059 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34060 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
34061 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
34062 }
34063 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
34064 UALBERTA_SYS_STATUS_DATA::ID => {
34065 UALBERTA_SYS_STATUS_DATA::deser(version, payload).map(Self::UALBERTA_SYS_STATUS)
34066 }
34067 UAVCAN_NODE_INFO_DATA::ID => {
34068 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
34069 }
34070 UAVCAN_NODE_STATUS_DATA::ID => {
34071 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
34072 }
34073 UTM_GLOBAL_POSITION_DATA::ID => {
34074 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
34075 }
34076 V2_EXTENSION_DATA::ID => {
34077 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
34078 }
34079 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
34080 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
34081 VICON_POSITION_ESTIMATE_DATA::ID => {
34082 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
34083 .map(Self::VICON_POSITION_ESTIMATE)
34084 }
34085 VIDEO_STREAM_INFORMATION_DATA::ID => {
34086 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
34087 .map(Self::VIDEO_STREAM_INFORMATION)
34088 }
34089 VIDEO_STREAM_STATUS_DATA::ID => {
34090 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
34091 }
34092 VISION_POSITION_ESTIMATE_DATA::ID => {
34093 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
34094 .map(Self::VISION_POSITION_ESTIMATE)
34095 }
34096 VISION_SPEED_ESTIMATE_DATA::ID => {
34097 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
34098 }
34099 WHEEL_DISTANCE_DATA::ID => {
34100 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
34101 }
34102 WIFI_CONFIG_AP_DATA::ID => {
34103 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
34104 }
34105 WINCH_STATUS_DATA::ID => {
34106 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
34107 }
34108 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
34109 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
34110 }
34111 }
34112 fn message_name(&self) -> &'static str {
34113 match self {
34114 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
34115 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
34116 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
34117 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
34118 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
34119 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
34120 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
34121 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
34122 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
34123 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
34124 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
34125 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34126 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
34127 }
34128 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
34129 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
34130 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
34131 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
34132 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
34133 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
34134 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
34135 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
34136 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
34137 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
34138 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
34139 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
34140 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
34141 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
34142 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
34143 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
34144 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
34145 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
34146 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
34147 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
34148 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
34149 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
34150 Self::COLLISION(..) => COLLISION_DATA::NAME,
34151 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
34152 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
34153 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
34154 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
34155 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
34156 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
34157 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
34158 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
34159 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
34160 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
34161 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
34162 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
34163 Self::DEBUG(..) => DEBUG_DATA::NAME,
34164 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
34165 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
34166 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
34167 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
34168 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
34169 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
34170 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
34171 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
34172 Self::EVENT(..) => EVENT_DATA::NAME,
34173 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
34174 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
34175 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
34176 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
34177 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
34178 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
34179 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
34180 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
34181 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
34182 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
34183 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
34184 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
34185 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34186 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
34187 }
34188 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
34189 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
34190 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
34191 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
34192 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
34193 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
34194 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
34195 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
34196 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
34197 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
34198 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
34199 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
34200 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
34201 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
34202 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
34203 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
34204 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
34205 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
34206 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
34207 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
34208 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
34209 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
34210 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
34211 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
34212 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
34213 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
34214 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
34215 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
34216 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
34217 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
34218 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
34219 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
34220 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
34221 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
34222 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34223 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
34224 }
34225 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
34226 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
34227 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
34228 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
34229 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
34230 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
34231 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
34232 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
34233 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
34234 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
34235 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
34236 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
34237 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
34238 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
34239 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
34240 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
34241 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
34242 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
34243 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
34244 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
34245 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
34246 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
34247 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
34248 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
34249 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
34250 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
34251 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
34252 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
34253 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
34254 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
34255 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
34256 Self::NAV_FILTER_BIAS(..) => NAV_FILTER_BIAS_DATA::NAME,
34257 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
34258 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
34259 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
34260 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
34261 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
34262 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
34263 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
34264 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
34265 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
34266 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
34267 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
34268 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
34269 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
34270 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
34271 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
34272 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
34273 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
34274 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
34275 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
34276 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
34277 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
34278 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
34279 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
34280 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
34281 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
34282 Self::PING(..) => PING_DATA::NAME,
34283 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
34284 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
34285 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34286 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
34287 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
34288 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
34289 Self::RADIO_CALIBRATION(..) => RADIO_CALIBRATION_DATA::NAME,
34290 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
34291 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
34292 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
34293 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
34294 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
34295 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
34296 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
34297 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
34298 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
34299 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
34300 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
34301 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
34302 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
34303 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
34304 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
34305 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
34306 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
34307 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
34308 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
34309 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
34310 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
34311 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
34312 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
34313 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
34314 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
34315 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
34316 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
34317 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
34318 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34319 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
34320 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
34321 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
34322 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
34323 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
34324 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
34325 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
34326 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
34327 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
34328 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
34329 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
34330 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
34331 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
34332 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
34333 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
34334 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
34335 }
34336 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34337 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
34338 }
34339 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
34340 Self::UALBERTA_SYS_STATUS(..) => UALBERTA_SYS_STATUS_DATA::NAME,
34341 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
34342 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
34343 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
34344 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
34345 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
34346 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
34347 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
34348 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
34349 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
34350 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
34351 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
34352 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
34353 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
34354 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
34355 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
34356 }
34357 }
34358 fn message_id(&self) -> u32 {
34359 match self {
34360 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
34361 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
34362 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
34363 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
34364 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
34365 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
34366 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
34367 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
34368 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
34369 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
34370 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
34371 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34372 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
34373 }
34374 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
34375 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
34376 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
34377 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
34378 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
34379 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
34380 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
34381 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
34382 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
34383 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
34384 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
34385 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
34386 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
34387 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
34388 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
34389 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
34390 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
34391 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
34392 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
34393 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
34394 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
34395 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
34396 Self::COLLISION(..) => COLLISION_DATA::ID,
34397 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
34398 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
34399 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
34400 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
34401 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
34402 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
34403 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
34404 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
34405 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
34406 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
34407 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
34408 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
34409 Self::DEBUG(..) => DEBUG_DATA::ID,
34410 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
34411 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
34412 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
34413 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
34414 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
34415 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
34416 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
34417 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
34418 Self::EVENT(..) => EVENT_DATA::ID,
34419 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
34420 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
34421 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
34422 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
34423 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
34424 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
34425 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
34426 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
34427 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
34428 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
34429 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
34430 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
34431 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34432 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
34433 }
34434 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
34435 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
34436 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
34437 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
34438 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
34439 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
34440 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
34441 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
34442 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
34443 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
34444 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
34445 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
34446 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
34447 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
34448 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
34449 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
34450 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
34451 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
34452 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
34453 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
34454 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
34455 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
34456 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
34457 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
34458 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
34459 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
34460 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
34461 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
34462 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
34463 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
34464 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
34465 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
34466 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
34467 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
34468 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34469 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
34470 }
34471 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
34472 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
34473 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
34474 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
34475 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
34476 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
34477 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
34478 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
34479 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
34480 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
34481 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
34482 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
34483 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
34484 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
34485 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
34486 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
34487 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
34488 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
34489 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
34490 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
34491 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
34492 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
34493 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
34494 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
34495 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
34496 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
34497 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
34498 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
34499 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
34500 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
34501 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
34502 Self::NAV_FILTER_BIAS(..) => NAV_FILTER_BIAS_DATA::ID,
34503 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
34504 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
34505 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
34506 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
34507 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
34508 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
34509 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
34510 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
34511 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
34512 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
34513 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
34514 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
34515 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
34516 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
34517 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
34518 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
34519 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
34520 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
34521 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
34522 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
34523 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
34524 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
34525 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
34526 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
34527 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
34528 Self::PING(..) => PING_DATA::ID,
34529 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
34530 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
34531 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
34532 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
34533 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
34534 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
34535 Self::RADIO_CALIBRATION(..) => RADIO_CALIBRATION_DATA::ID,
34536 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
34537 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
34538 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
34539 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
34540 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
34541 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
34542 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
34543 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
34544 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
34545 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
34546 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
34547 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
34548 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
34549 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
34550 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
34551 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
34552 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
34553 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
34554 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
34555 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
34556 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
34557 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
34558 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
34559 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
34560 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
34561 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
34562 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
34563 Self::SET_MODE(..) => SET_MODE_DATA::ID,
34564 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
34565 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
34566 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
34567 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
34568 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
34569 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
34570 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
34571 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
34572 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
34573 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
34574 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
34575 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
34576 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
34577 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
34578 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
34579 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
34580 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34581 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
34582 }
34583 Self::TUNNEL(..) => TUNNEL_DATA::ID,
34584 Self::UALBERTA_SYS_STATUS(..) => UALBERTA_SYS_STATUS_DATA::ID,
34585 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
34586 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
34587 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
34588 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
34589 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
34590 Self::VIBRATION(..) => VIBRATION_DATA::ID,
34591 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
34592 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
34593 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
34594 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
34595 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
34596 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
34597 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
34598 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
34599 Self::WIND_COV(..) => WIND_COV_DATA::ID,
34600 }
34601 }
34602 fn message_id_from_name(name: &str) -> Option<u32> {
34603 match name {
34604 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
34605 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
34606 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
34607 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
34608 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
34609 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
34610 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
34611 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
34612 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
34613 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
34614 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
34615 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
34616 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
34617 }
34618 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
34619 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
34620 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
34621 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
34622 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
34623 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
34624 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
34625 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
34626 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
34627 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
34628 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
34629 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
34630 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
34631 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
34632 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
34633 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
34634 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
34635 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
34636 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
34637 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
34638 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
34639 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
34640 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
34641 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
34642 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
34643 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
34644 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
34645 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
34646 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
34647 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
34648 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
34649 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
34650 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
34651 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
34652 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
34653 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
34654 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
34655 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
34656 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
34657 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
34658 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
34659 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
34660 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
34661 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
34662 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
34663 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
34664 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
34665 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
34666 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
34667 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
34668 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
34669 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
34670 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
34671 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
34672 }
34673 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
34674 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
34675 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
34676 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
34677 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
34678 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
34679 }
34680 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
34681 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
34682 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
34683 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
34684 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
34685 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
34686 }
34687 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
34688 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
34689 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
34690 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
34691 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
34692 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
34693 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
34694 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
34695 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
34696 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
34697 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
34698 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
34699 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
34700 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
34701 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
34702 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
34703 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
34704 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
34705 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
34706 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
34707 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
34708 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
34709 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
34710 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
34711 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
34712 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
34713 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
34714 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
34715 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
34716 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
34717 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
34718 }
34719 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
34720 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
34721 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
34722 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
34723 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
34724 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
34725 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
34726 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
34727 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
34728 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
34729 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
34730 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
34731 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
34732 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
34733 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
34734 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
34735 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
34736 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
34737 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
34738 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
34739 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
34740 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
34741 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
34742 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
34743 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
34744 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
34745 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
34746 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
34747 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
34748 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
34749 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
34750 NAV_FILTER_BIAS_DATA::NAME => Some(NAV_FILTER_BIAS_DATA::ID),
34751 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
34752 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
34753 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
34754 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
34755 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
34756 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
34757 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
34758 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
34759 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
34760 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
34761 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
34762 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
34763 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
34764 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
34765 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
34766 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
34767 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
34768 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
34769 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
34770 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
34771 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
34772 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
34773 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
34774 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
34775 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
34776 PING_DATA::NAME => Some(PING_DATA::ID),
34777 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
34778 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
34779 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
34780 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
34781 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
34782 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
34783 RADIO_CALIBRATION_DATA::NAME => Some(RADIO_CALIBRATION_DATA::ID),
34784 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
34785 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
34786 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
34787 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
34788 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
34789 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
34790 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
34791 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
34792 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
34793 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
34794 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
34795 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
34796 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
34797 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
34798 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
34799 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
34800 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
34801 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
34802 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
34803 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
34804 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
34805 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
34806 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
34807 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
34808 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
34809 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
34810 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
34811 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
34812 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
34813 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
34814 }
34815 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
34816 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
34817 }
34818 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
34819 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
34820 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
34821 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
34822 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
34823 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
34824 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
34825 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
34826 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
34827 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
34828 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
34829 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
34830 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
34831 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
34832 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
34833 }
34834 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
34835 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
34836 }
34837 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
34838 UALBERTA_SYS_STATUS_DATA::NAME => Some(UALBERTA_SYS_STATUS_DATA::ID),
34839 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
34840 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
34841 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
34842 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
34843 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
34844 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
34845 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
34846 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
34847 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
34848 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
34849 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
34850 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
34851 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
34852 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
34853 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
34854 _ => None,
34855 }
34856 }
34857 fn default_message_from_id(id: u32) -> Option<Self> {
34858 match id {
34859 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34860 ACTUATOR_CONTROL_TARGET_DATA::default(),
34861 )),
34862 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34863 ACTUATOR_OUTPUT_STATUS_DATA::default(),
34864 )),
34865 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
34866 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
34867 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
34868 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
34869 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34870 ATTITUDE_QUATERNION_DATA::default(),
34871 )),
34872 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34873 ATTITUDE_QUATERNION_COV_DATA::default(),
34874 )),
34875 ATTITUDE_TARGET_DATA::ID => {
34876 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
34877 }
34878 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
34879 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
34880 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34881 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34882 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
34883 ))
34884 }
34885 AUTOPILOT_VERSION_DATA::ID => {
34886 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
34887 }
34888 AVAILABLE_MODES_DATA::ID => {
34889 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
34890 }
34891 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34892 AVAILABLE_MODES_MONITOR_DATA::default(),
34893 )),
34894 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
34895 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
34896 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
34897 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34898 CAMERA_CAPTURE_STATUS_DATA::default(),
34899 )),
34900 CAMERA_FOV_STATUS_DATA::ID => {
34901 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
34902 }
34903 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34904 CAMERA_IMAGE_CAPTURED_DATA::default(),
34905 )),
34906 CAMERA_INFORMATION_DATA::ID => {
34907 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
34908 }
34909 CAMERA_SETTINGS_DATA::ID => {
34910 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
34911 }
34912 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
34913 CAMERA_THERMAL_RANGE_DATA::default(),
34914 )),
34915 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
34916 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
34917 )),
34918 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34919 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
34920 )),
34921 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
34922 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
34923 CAN_FILTER_MODIFY_DATA::ID => {
34924 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
34925 }
34926 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
34927 CELLULAR_CONFIG_DATA::ID => {
34928 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
34929 }
34930 CELLULAR_STATUS_DATA::ID => {
34931 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
34932 }
34933 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34934 CHANGE_OPERATOR_CONTROL_DATA::default(),
34935 )),
34936 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34937 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
34938 )),
34939 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
34940 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
34941 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
34942 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
34943 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
34944 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
34945 COMPONENT_INFORMATION_DATA::default(),
34946 )),
34947 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34948 COMPONENT_INFORMATION_BASIC_DATA::default(),
34949 )),
34950 COMPONENT_METADATA_DATA::ID => {
34951 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
34952 }
34953 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34954 CONTROL_SYSTEM_STATE_DATA::default(),
34955 )),
34956 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34957 CURRENT_EVENT_SEQUENCE_DATA::default(),
34958 )),
34959 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
34960 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
34961 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
34962 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
34963 )),
34964 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
34965 DEBUG_FLOAT_ARRAY_DATA::ID => {
34966 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
34967 }
34968 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
34969 DISTANCE_SENSOR_DATA::ID => {
34970 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
34971 }
34972 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
34973 ENCAPSULATED_DATA_DATA::ID => {
34974 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
34975 }
34976 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
34977 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
34978 ESTIMATOR_STATUS_DATA::ID => {
34979 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
34980 }
34981 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
34982 EXTENDED_SYS_STATE_DATA::ID => {
34983 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
34984 }
34985 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
34986 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34987 FILE_TRANSFER_PROTOCOL_DATA::default(),
34988 )),
34989 FLIGHT_INFORMATION_DATA::ID => {
34990 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
34991 }
34992 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
34993 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
34994 GENERATOR_STATUS_DATA::ID => {
34995 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
34996 }
34997 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34998 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
34999 )),
35000 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35001 GIMBAL_DEVICE_INFORMATION_DATA::default(),
35002 )),
35003 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35004 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
35005 )),
35006 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35007 GIMBAL_MANAGER_INFORMATION_DATA::default(),
35008 )),
35009 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35010 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
35011 )),
35012 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35013 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35014 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
35015 ))
35016 }
35017 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35018 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
35019 )),
35020 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35021 GIMBAL_MANAGER_STATUS_DATA::default(),
35022 )),
35023 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35024 GLOBAL_POSITION_INT_DATA::default(),
35025 )),
35026 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35027 GLOBAL_POSITION_INT_COV_DATA::default(),
35028 )),
35029 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35030 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35031 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
35032 ))
35033 }
35034 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
35035 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
35036 GPS_GLOBAL_ORIGIN_DATA::ID => {
35037 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
35038 }
35039 GPS_INJECT_DATA_DATA::ID => {
35040 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
35041 }
35042 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
35043 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
35044 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
35045 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
35046 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
35047 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
35048 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
35049 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
35050 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
35051 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35052 HIL_ACTUATOR_CONTROLS_DATA::default(),
35053 )),
35054 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
35055 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
35056 HIL_OPTICAL_FLOW_DATA::ID => {
35057 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
35058 }
35059 HIL_RC_INPUTS_RAW_DATA::ID => {
35060 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
35061 }
35062 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
35063 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
35064 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35065 HIL_STATE_QUATERNION_DATA::default(),
35066 )),
35067 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
35068 HYGROMETER_SENSOR_DATA::ID => {
35069 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
35070 }
35071 ILLUMINATOR_STATUS_DATA::ID => {
35072 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
35073 }
35074 ISBD_LINK_STATUS_DATA::ID => {
35075 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
35076 }
35077 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
35078 LINK_NODE_STATUS_DATA::ID => {
35079 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
35080 }
35081 LOCAL_POSITION_NED_DATA::ID => {
35082 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
35083 }
35084 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35085 LOCAL_POSITION_NED_COV_DATA::default(),
35086 )),
35087 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35088 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35089 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
35090 ))
35091 }
35092 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
35093 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
35094 LOGGING_DATA_ACKED_DATA::ID => {
35095 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
35096 }
35097 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
35098 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
35099 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
35100 LOG_REQUEST_DATA_DATA::ID => {
35101 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
35102 }
35103 LOG_REQUEST_END_DATA::ID => {
35104 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
35105 }
35106 LOG_REQUEST_LIST_DATA::ID => {
35107 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
35108 }
35109 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
35110 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
35111 MANUAL_SETPOINT_DATA::ID => {
35112 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
35113 }
35114 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
35115 MESSAGE_INTERVAL_DATA::ID => {
35116 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
35117 }
35118 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
35119 MISSION_CLEAR_ALL_DATA::ID => {
35120 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
35121 }
35122 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
35123 MISSION_CURRENT_DATA::ID => {
35124 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
35125 }
35126 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
35127 MISSION_ITEM_INT_DATA::ID => {
35128 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
35129 }
35130 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35131 MISSION_ITEM_REACHED_DATA::default(),
35132 )),
35133 MISSION_REQUEST_DATA::ID => {
35134 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
35135 }
35136 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35137 MISSION_REQUEST_INT_DATA::default(),
35138 )),
35139 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35140 MISSION_REQUEST_LIST_DATA::default(),
35141 )),
35142 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35143 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
35144 )),
35145 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35146 MISSION_SET_CURRENT_DATA::default(),
35147 )),
35148 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35149 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
35150 )),
35151 MOUNT_ORIENTATION_DATA::ID => {
35152 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
35153 }
35154 NAMED_VALUE_FLOAT_DATA::ID => {
35155 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
35156 }
35157 NAMED_VALUE_INT_DATA::ID => {
35158 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
35159 }
35160 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35161 NAV_CONTROLLER_OUTPUT_DATA::default(),
35162 )),
35163 NAV_FILTER_BIAS_DATA::ID => {
35164 Some(Self::NAV_FILTER_BIAS(NAV_FILTER_BIAS_DATA::default()))
35165 }
35166 OBSTACLE_DISTANCE_DATA::ID => {
35167 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
35168 }
35169 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
35170 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35171 ONBOARD_COMPUTER_STATUS_DATA::default(),
35172 )),
35173 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35174 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
35175 )),
35176 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35177 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
35178 )),
35179 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35180 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
35181 )),
35182 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35183 OPEN_DRONE_ID_LOCATION_DATA::default(),
35184 )),
35185 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35186 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
35187 )),
35188 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35189 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
35190 )),
35191 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35192 OPEN_DRONE_ID_SELF_ID_DATA::default(),
35193 )),
35194 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35195 OPEN_DRONE_ID_SYSTEM_DATA::default(),
35196 )),
35197 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35198 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
35199 )),
35200 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
35201 OPTICAL_FLOW_RAD_DATA::ID => {
35202 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
35203 }
35204 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35205 ORBIT_EXECUTION_STATUS_DATA::default(),
35206 )),
35207 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
35208 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35209 PARAM_EXT_REQUEST_LIST_DATA::default(),
35210 )),
35211 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35212 PARAM_EXT_REQUEST_READ_DATA::default(),
35213 )),
35214 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
35215 PARAM_EXT_VALUE_DATA::ID => {
35216 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
35217 }
35218 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
35219 PARAM_REQUEST_LIST_DATA::ID => {
35220 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
35221 }
35222 PARAM_REQUEST_READ_DATA::ID => {
35223 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
35224 }
35225 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
35226 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
35227 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
35228 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
35229 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
35230 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35231 POSITION_TARGET_GLOBAL_INT_DATA::default(),
35232 )),
35233 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35234 POSITION_TARGET_LOCAL_NED_DATA::default(),
35235 )),
35236 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
35237 PROTOCOL_VERSION_DATA::ID => {
35238 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
35239 }
35240 RADIO_CALIBRATION_DATA::ID => {
35241 Some(Self::RADIO_CALIBRATION(RADIO_CALIBRATION_DATA::default()))
35242 }
35243 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
35244 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
35245 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
35246 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
35247 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
35248 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35249 RC_CHANNELS_OVERRIDE_DATA::default(),
35250 )),
35251 RC_CHANNELS_RAW_DATA::ID => {
35252 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
35253 }
35254 RC_CHANNELS_SCALED_DATA::ID => {
35255 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
35256 }
35257 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35258 REQUEST_DATA_STREAM_DATA::default(),
35259 )),
35260 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
35261 RESOURCE_REQUEST_DATA::ID => {
35262 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
35263 }
35264 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35265 RESPONSE_EVENT_ERROR_DATA::default(),
35266 )),
35267 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35268 SAFETY_ALLOWED_AREA_DATA::default(),
35269 )),
35270 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35271 SAFETY_SET_ALLOWED_AREA_DATA::default(),
35272 )),
35273 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
35274 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
35275 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
35276 SCALED_PRESSURE_DATA::ID => {
35277 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
35278 }
35279 SCALED_PRESSURE2_DATA::ID => {
35280 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
35281 }
35282 SCALED_PRESSURE3_DATA::ID => {
35283 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
35284 }
35285 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
35286 SERVO_OUTPUT_RAW_DATA::ID => {
35287 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
35288 }
35289 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
35290 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35291 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
35292 )),
35293 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35294 SET_ATTITUDE_TARGET_DATA::default(),
35295 )),
35296 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35297 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
35298 )),
35299 SET_HOME_POSITION_DATA::ID => {
35300 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
35301 }
35302 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
35303 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35304 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
35305 )),
35306 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35307 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
35308 )),
35309 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
35310 SMART_BATTERY_INFO_DATA::ID => {
35311 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
35312 }
35313 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
35314 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35315 STORAGE_INFORMATION_DATA::default(),
35316 )),
35317 SUPPORTED_TUNES_DATA::ID => {
35318 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
35319 }
35320 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
35321 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
35322 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
35323 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
35324 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
35325 TERRAIN_REQUEST_DATA::ID => {
35326 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
35327 }
35328 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
35329 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35330 TIME_ESTIMATE_TO_TARGET_DATA::default(),
35331 )),
35332 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35333 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35334 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
35335 ))
35336 }
35337 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35338 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35339 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
35340 ))
35341 }
35342 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
35343 UALBERTA_SYS_STATUS_DATA::ID => Some(Self::UALBERTA_SYS_STATUS(
35344 UALBERTA_SYS_STATUS_DATA::default(),
35345 )),
35346 UAVCAN_NODE_INFO_DATA::ID => {
35347 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
35348 }
35349 UAVCAN_NODE_STATUS_DATA::ID => {
35350 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
35351 }
35352 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35353 UTM_GLOBAL_POSITION_DATA::default(),
35354 )),
35355 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
35356 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
35357 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
35358 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35359 VICON_POSITION_ESTIMATE_DATA::default(),
35360 )),
35361 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35362 VIDEO_STREAM_INFORMATION_DATA::default(),
35363 )),
35364 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35365 VIDEO_STREAM_STATUS_DATA::default(),
35366 )),
35367 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35368 VISION_POSITION_ESTIMATE_DATA::default(),
35369 )),
35370 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35371 VISION_SPEED_ESTIMATE_DATA::default(),
35372 )),
35373 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
35374 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
35375 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
35376 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
35377 _ => None,
35378 }
35379 }
35380 #[cfg(feature = "arbitrary")]
35381 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
35382 match id {
35383 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
35384 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35385 )),
35386 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
35387 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
35388 )),
35389 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
35390 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
35391 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
35392 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
35393 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35394 ATTITUDE_QUATERNION_DATA::random(rng),
35395 )),
35396 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35397 ATTITUDE_QUATERNION_COV_DATA::random(rng),
35398 )),
35399 ATTITUDE_TARGET_DATA::ID => {
35400 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
35401 }
35402 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
35403 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
35404 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35405 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35406 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
35407 ))
35408 }
35409 AUTOPILOT_VERSION_DATA::ID => {
35410 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
35411 }
35412 AVAILABLE_MODES_DATA::ID => {
35413 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
35414 }
35415 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35416 AVAILABLE_MODES_MONITOR_DATA::random(rng),
35417 )),
35418 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
35419 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
35420 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
35421 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
35422 CAMERA_CAPTURE_STATUS_DATA::random(rng),
35423 )),
35424 CAMERA_FOV_STATUS_DATA::ID => {
35425 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
35426 }
35427 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35428 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
35429 )),
35430 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
35431 CAMERA_INFORMATION_DATA::random(rng),
35432 )),
35433 CAMERA_SETTINGS_DATA::ID => {
35434 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
35435 }
35436 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35437 CAMERA_THERMAL_RANGE_DATA::random(rng),
35438 )),
35439 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35440 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
35441 )),
35442 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35443 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
35444 )),
35445 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
35446 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
35447 CAN_FILTER_MODIFY_DATA::ID => {
35448 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
35449 }
35450 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
35451 CELLULAR_CONFIG_DATA::ID => {
35452 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
35453 }
35454 CELLULAR_STATUS_DATA::ID => {
35455 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
35456 }
35457 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35458 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
35459 )),
35460 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35461 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
35462 )),
35463 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
35464 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
35465 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
35466 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
35467 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
35468 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35469 COMPONENT_INFORMATION_DATA::random(rng),
35470 )),
35471 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35472 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
35473 )),
35474 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
35475 COMPONENT_METADATA_DATA::random(rng),
35476 )),
35477 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35478 CONTROL_SYSTEM_STATE_DATA::random(rng),
35479 )),
35480 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35481 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
35482 )),
35483 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
35484 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
35485 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35486 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
35487 )),
35488 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
35489 DEBUG_FLOAT_ARRAY_DATA::ID => {
35490 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
35491 }
35492 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
35493 DISTANCE_SENSOR_DATA::ID => {
35494 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
35495 }
35496 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
35497 ENCAPSULATED_DATA_DATA::ID => {
35498 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
35499 }
35500 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
35501 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
35502 ESTIMATOR_STATUS_DATA::ID => {
35503 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
35504 }
35505 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
35506 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
35507 EXTENDED_SYS_STATE_DATA::random(rng),
35508 )),
35509 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
35510 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35511 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
35512 )),
35513 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
35514 FLIGHT_INFORMATION_DATA::random(rng),
35515 )),
35516 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
35517 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
35518 GENERATOR_STATUS_DATA::ID => {
35519 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
35520 }
35521 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35522 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
35523 )),
35524 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35525 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
35526 )),
35527 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35528 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
35529 )),
35530 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35531 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
35532 )),
35533 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35534 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
35535 )),
35536 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35537 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35538 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
35539 ))
35540 }
35541 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35542 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
35543 )),
35544 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35545 GIMBAL_MANAGER_STATUS_DATA::random(rng),
35546 )),
35547 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35548 GLOBAL_POSITION_INT_DATA::random(rng),
35549 )),
35550 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35551 GLOBAL_POSITION_INT_COV_DATA::random(rng),
35552 )),
35553 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35554 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35555 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
35556 ))
35557 }
35558 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
35559 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
35560 GPS_GLOBAL_ORIGIN_DATA::ID => {
35561 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
35562 }
35563 GPS_INJECT_DATA_DATA::ID => {
35564 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
35565 }
35566 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
35567 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
35568 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
35569 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
35570 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
35571 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
35572 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
35573 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
35574 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
35575 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35576 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
35577 )),
35578 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
35579 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
35580 HIL_OPTICAL_FLOW_DATA::ID => {
35581 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
35582 }
35583 HIL_RC_INPUTS_RAW_DATA::ID => {
35584 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
35585 }
35586 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
35587 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
35588 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35589 HIL_STATE_QUATERNION_DATA::random(rng),
35590 )),
35591 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
35592 HYGROMETER_SENSOR_DATA::ID => {
35593 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
35594 }
35595 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
35596 ILLUMINATOR_STATUS_DATA::random(rng),
35597 )),
35598 ISBD_LINK_STATUS_DATA::ID => {
35599 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
35600 }
35601 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
35602 LINK_NODE_STATUS_DATA::ID => {
35603 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
35604 }
35605 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
35606 LOCAL_POSITION_NED_DATA::random(rng),
35607 )),
35608 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35609 LOCAL_POSITION_NED_COV_DATA::random(rng),
35610 )),
35611 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35612 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35613 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
35614 ))
35615 }
35616 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
35617 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
35618 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
35619 LOGGING_DATA_ACKED_DATA::random(rng),
35620 )),
35621 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
35622 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
35623 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
35624 LOG_REQUEST_DATA_DATA::ID => {
35625 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
35626 }
35627 LOG_REQUEST_END_DATA::ID => {
35628 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
35629 }
35630 LOG_REQUEST_LIST_DATA::ID => {
35631 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
35632 }
35633 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
35634 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
35635 MANUAL_SETPOINT_DATA::ID => {
35636 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
35637 }
35638 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
35639 MESSAGE_INTERVAL_DATA::ID => {
35640 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
35641 }
35642 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
35643 MISSION_CLEAR_ALL_DATA::ID => {
35644 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
35645 }
35646 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
35647 MISSION_CURRENT_DATA::ID => {
35648 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
35649 }
35650 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
35651 MISSION_ITEM_INT_DATA::ID => {
35652 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
35653 }
35654 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35655 MISSION_ITEM_REACHED_DATA::random(rng),
35656 )),
35657 MISSION_REQUEST_DATA::ID => {
35658 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
35659 }
35660 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35661 MISSION_REQUEST_INT_DATA::random(rng),
35662 )),
35663 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35664 MISSION_REQUEST_LIST_DATA::random(rng),
35665 )),
35666 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35667 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
35668 )),
35669 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35670 MISSION_SET_CURRENT_DATA::random(rng),
35671 )),
35672 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35673 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
35674 )),
35675 MOUNT_ORIENTATION_DATA::ID => {
35676 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
35677 }
35678 NAMED_VALUE_FLOAT_DATA::ID => {
35679 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
35680 }
35681 NAMED_VALUE_INT_DATA::ID => {
35682 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
35683 }
35684 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35685 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
35686 )),
35687 NAV_FILTER_BIAS_DATA::ID => {
35688 Some(Self::NAV_FILTER_BIAS(NAV_FILTER_BIAS_DATA::random(rng)))
35689 }
35690 OBSTACLE_DISTANCE_DATA::ID => {
35691 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
35692 }
35693 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
35694 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35695 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
35696 )),
35697 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35698 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
35699 )),
35700 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35701 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
35702 )),
35703 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35704 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
35705 )),
35706 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35707 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
35708 )),
35709 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35710 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
35711 )),
35712 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35713 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
35714 )),
35715 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35716 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
35717 )),
35718 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35719 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
35720 )),
35721 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35722 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
35723 )),
35724 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
35725 OPTICAL_FLOW_RAD_DATA::ID => {
35726 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
35727 }
35728 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35729 ORBIT_EXECUTION_STATUS_DATA::random(rng),
35730 )),
35731 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
35732 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35733 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
35734 )),
35735 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35736 PARAM_EXT_REQUEST_READ_DATA::random(rng),
35737 )),
35738 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
35739 PARAM_EXT_VALUE_DATA::ID => {
35740 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
35741 }
35742 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
35743 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
35744 PARAM_REQUEST_LIST_DATA::random(rng),
35745 )),
35746 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
35747 PARAM_REQUEST_READ_DATA::random(rng),
35748 )),
35749 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
35750 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
35751 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
35752 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
35753 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
35754 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35755 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35756 )),
35757 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35758 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35759 )),
35760 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
35761 PROTOCOL_VERSION_DATA::ID => {
35762 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
35763 }
35764 RADIO_CALIBRATION_DATA::ID => {
35765 Some(Self::RADIO_CALIBRATION(RADIO_CALIBRATION_DATA::random(rng)))
35766 }
35767 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
35768 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
35769 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
35770 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
35771 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
35772 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35773 RC_CHANNELS_OVERRIDE_DATA::random(rng),
35774 )),
35775 RC_CHANNELS_RAW_DATA::ID => {
35776 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
35777 }
35778 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
35779 RC_CHANNELS_SCALED_DATA::random(rng),
35780 )),
35781 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35782 REQUEST_DATA_STREAM_DATA::random(rng),
35783 )),
35784 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
35785 RESOURCE_REQUEST_DATA::ID => {
35786 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
35787 }
35788 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35789 RESPONSE_EVENT_ERROR_DATA::random(rng),
35790 )),
35791 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35792 SAFETY_ALLOWED_AREA_DATA::random(rng),
35793 )),
35794 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35795 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
35796 )),
35797 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
35798 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
35799 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
35800 SCALED_PRESSURE_DATA::ID => {
35801 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
35802 }
35803 SCALED_PRESSURE2_DATA::ID => {
35804 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
35805 }
35806 SCALED_PRESSURE3_DATA::ID => {
35807 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
35808 }
35809 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
35810 SERVO_OUTPUT_RAW_DATA::ID => {
35811 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
35812 }
35813 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
35814 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35815 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35816 )),
35817 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35818 SET_ATTITUDE_TARGET_DATA::random(rng),
35819 )),
35820 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35821 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
35822 )),
35823 SET_HOME_POSITION_DATA::ID => {
35824 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
35825 }
35826 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
35827 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35828 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35829 )),
35830 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35831 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35832 )),
35833 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
35834 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
35835 SMART_BATTERY_INFO_DATA::random(rng),
35836 )),
35837 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
35838 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35839 STORAGE_INFORMATION_DATA::random(rng),
35840 )),
35841 SUPPORTED_TUNES_DATA::ID => {
35842 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
35843 }
35844 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
35845 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
35846 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
35847 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
35848 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
35849 TERRAIN_REQUEST_DATA::ID => {
35850 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
35851 }
35852 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
35853 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35854 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
35855 )),
35856 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35857 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35858 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
35859 ))
35860 }
35861 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35862 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35863 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
35864 ))
35865 }
35866 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
35867 UALBERTA_SYS_STATUS_DATA::ID => Some(Self::UALBERTA_SYS_STATUS(
35868 UALBERTA_SYS_STATUS_DATA::random(rng),
35869 )),
35870 UAVCAN_NODE_INFO_DATA::ID => {
35871 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
35872 }
35873 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
35874 UAVCAN_NODE_STATUS_DATA::random(rng),
35875 )),
35876 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35877 UTM_GLOBAL_POSITION_DATA::random(rng),
35878 )),
35879 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
35880 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
35881 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
35882 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35883 VICON_POSITION_ESTIMATE_DATA::random(rng),
35884 )),
35885 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35886 VIDEO_STREAM_INFORMATION_DATA::random(rng),
35887 )),
35888 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35889 VIDEO_STREAM_STATUS_DATA::random(rng),
35890 )),
35891 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35892 VISION_POSITION_ESTIMATE_DATA::random(rng),
35893 )),
35894 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35895 VISION_SPEED_ESTIMATE_DATA::random(rng),
35896 )),
35897 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
35898 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
35899 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
35900 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
35901 _ => None,
35902 }
35903 }
35904 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35905 match self {
35906 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35907 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
35908 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
35909 Self::AIS_VESSEL(body) => body.ser(version, bytes),
35910 Self::ALTITUDE(body) => body.ser(version, bytes),
35911 Self::ATTITUDE(body) => body.ser(version, bytes),
35912 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
35913 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
35914 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
35915 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
35916 Self::AUTH_KEY(body) => body.ser(version, bytes),
35917 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
35918 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
35919 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
35920 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
35921 Self::BATTERY_INFO(body) => body.ser(version, bytes),
35922 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
35923 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
35924 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
35925 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
35926 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
35927 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
35928 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
35929 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
35930 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
35931 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
35932 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
35933 Self::CANFD_FRAME(body) => body.ser(version, bytes),
35934 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
35935 Self::CAN_FRAME(body) => body.ser(version, bytes),
35936 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
35937 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
35938 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
35939 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
35940 Self::COLLISION(body) => body.ser(version, bytes),
35941 Self::COMMAND_ACK(body) => body.ser(version, bytes),
35942 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
35943 Self::COMMAND_INT(body) => body.ser(version, bytes),
35944 Self::COMMAND_LONG(body) => body.ser(version, bytes),
35945 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
35946 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
35947 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
35948 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
35949 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
35950 Self::CURRENT_MODE(body) => body.ser(version, bytes),
35951 Self::DATA_STREAM(body) => body.ser(version, bytes),
35952 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
35953 Self::DEBUG(body) => body.ser(version, bytes),
35954 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
35955 Self::DEBUG_VECT(body) => body.ser(version, bytes),
35956 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
35957 Self::EFI_STATUS(body) => body.ser(version, bytes),
35958 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
35959 Self::ESC_INFO(body) => body.ser(version, bytes),
35960 Self::ESC_STATUS(body) => body.ser(version, bytes),
35961 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
35962 Self::EVENT(body) => body.ser(version, bytes),
35963 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
35964 Self::FENCE_STATUS(body) => body.ser(version, bytes),
35965 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
35966 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
35967 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
35968 Self::FUEL_STATUS(body) => body.ser(version, bytes),
35969 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
35970 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
35971 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
35972 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
35973 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
35974 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
35975 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
35976 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
35977 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
35978 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
35979 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
35980 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35981 Self::GPS2_RAW(body) => body.ser(version, bytes),
35982 Self::GPS2_RTK(body) => body.ser(version, bytes),
35983 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35984 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
35985 Self::GPS_INPUT(body) => body.ser(version, bytes),
35986 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
35987 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
35988 Self::GPS_RTK(body) => body.ser(version, bytes),
35989 Self::GPS_STATUS(body) => body.ser(version, bytes),
35990 Self::HEARTBEAT(body) => body.ser(version, bytes),
35991 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
35992 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
35993 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
35994 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
35995 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
35996 Self::HIL_GPS(body) => body.ser(version, bytes),
35997 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
35998 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
35999 Self::HIL_SENSOR(body) => body.ser(version, bytes),
36000 Self::HIL_STATE(body) => body.ser(version, bytes),
36001 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
36002 Self::HOME_POSITION(body) => body.ser(version, bytes),
36003 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
36004 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
36005 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
36006 Self::LANDING_TARGET(body) => body.ser(version, bytes),
36007 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
36008 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
36009 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
36010 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
36011 Self::LOGGING_ACK(body) => body.ser(version, bytes),
36012 Self::LOGGING_DATA(body) => body.ser(version, bytes),
36013 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
36014 Self::LOG_DATA(body) => body.ser(version, bytes),
36015 Self::LOG_ENTRY(body) => body.ser(version, bytes),
36016 Self::LOG_ERASE(body) => body.ser(version, bytes),
36017 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
36018 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
36019 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
36020 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
36021 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
36022 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
36023 Self::MEMORY_VECT(body) => body.ser(version, bytes),
36024 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
36025 Self::MISSION_ACK(body) => body.ser(version, bytes),
36026 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
36027 Self::MISSION_COUNT(body) => body.ser(version, bytes),
36028 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
36029 Self::MISSION_ITEM(body) => body.ser(version, bytes),
36030 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
36031 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
36032 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
36033 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
36034 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
36035 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
36036 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
36037 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
36038 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
36039 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
36040 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
36041 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
36042 Self::NAV_FILTER_BIAS(body) => body.ser(version, bytes),
36043 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
36044 Self::ODOMETRY(body) => body.ser(version, bytes),
36045 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
36046 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
36047 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
36048 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
36049 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
36050 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
36051 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
36052 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
36053 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
36054 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
36055 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
36056 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
36057 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
36058 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
36059 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
36060 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
36061 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
36062 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
36063 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
36064 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
36065 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
36066 Self::PARAM_SET(body) => body.ser(version, bytes),
36067 Self::PARAM_VALUE(body) => body.ser(version, bytes),
36068 Self::PING(body) => body.ser(version, bytes),
36069 Self::PLAY_TUNE(body) => body.ser(version, bytes),
36070 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
36071 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36072 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36073 Self::POWER_STATUS(body) => body.ser(version, bytes),
36074 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
36075 Self::RADIO_CALIBRATION(body) => body.ser(version, bytes),
36076 Self::RADIO_STATUS(body) => body.ser(version, bytes),
36077 Self::RAW_IMU(body) => body.ser(version, bytes),
36078 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
36079 Self::RAW_RPM(body) => body.ser(version, bytes),
36080 Self::RC_CHANNELS(body) => body.ser(version, bytes),
36081 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
36082 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
36083 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
36084 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
36085 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
36086 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
36087 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
36088 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
36089 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
36090 Self::SCALED_IMU(body) => body.ser(version, bytes),
36091 Self::SCALED_IMU2(body) => body.ser(version, bytes),
36092 Self::SCALED_IMU3(body) => body.ser(version, bytes),
36093 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
36094 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
36095 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
36096 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
36097 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
36098 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
36099 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36100 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
36101 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36102 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
36103 Self::SET_MODE(body) => body.ser(version, bytes),
36104 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36105 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36106 Self::SIM_STATE(body) => body.ser(version, bytes),
36107 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
36108 Self::STATUSTEXT(body) => body.ser(version, bytes),
36109 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
36110 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
36111 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
36112 Self::SYS_STATUS(body) => body.ser(version, bytes),
36113 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
36114 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
36115 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
36116 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
36117 Self::TIMESYNC(body) => body.ser(version, bytes),
36118 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
36119 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
36120 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
36121 Self::TUNNEL(body) => body.ser(version, bytes),
36122 Self::UALBERTA_SYS_STATUS(body) => body.ser(version, bytes),
36123 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
36124 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
36125 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
36126 Self::V2_EXTENSION(body) => body.ser(version, bytes),
36127 Self::VFR_HUD(body) => body.ser(version, bytes),
36128 Self::VIBRATION(body) => body.ser(version, bytes),
36129 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36130 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
36131 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
36132 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36133 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
36134 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
36135 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
36136 Self::WINCH_STATUS(body) => body.ser(version, bytes),
36137 Self::WIND_COV(body) => body.ser(version, bytes),
36138 }
36139 }
36140 fn extra_crc(id: u32) -> u8 {
36141 match id {
36142 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36143 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
36144 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
36145 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
36146 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
36147 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
36148 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
36149 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
36150 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
36151 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
36152 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
36153 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36154 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
36155 }
36156 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
36157 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
36158 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
36159 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
36160 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
36161 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
36162 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
36163 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
36164 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
36165 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
36166 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
36167 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
36168 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
36169 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
36170 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
36171 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
36172 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
36173 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
36174 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
36175 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
36176 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
36177 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
36178 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
36179 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
36180 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
36181 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
36182 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
36183 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
36184 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
36185 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
36186 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
36187 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
36188 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
36189 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
36190 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
36191 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
36192 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
36193 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
36194 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
36195 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
36196 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
36197 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
36198 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
36199 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
36200 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
36201 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
36202 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
36203 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
36204 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
36205 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
36206 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
36207 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
36208 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
36209 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
36210 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
36211 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
36212 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
36213 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36214 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
36215 }
36216 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
36217 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
36218 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
36219 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
36220 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36221 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
36222 }
36223 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
36224 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
36225 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36226 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
36227 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
36228 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
36229 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
36230 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
36231 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
36232 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
36233 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
36234 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
36235 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
36236 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
36237 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
36238 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
36239 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
36240 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
36241 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
36242 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
36243 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
36244 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
36245 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
36246 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
36247 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
36248 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
36249 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
36250 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
36251 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
36252 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36253 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
36254 }
36255 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
36256 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
36257 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
36258 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
36259 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
36260 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
36261 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
36262 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
36263 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
36264 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
36265 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
36266 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
36267 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
36268 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
36269 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
36270 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
36271 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
36272 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
36273 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
36274 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
36275 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
36276 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
36277 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
36278 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
36279 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
36280 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
36281 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
36282 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
36283 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
36284 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
36285 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
36286 NAV_FILTER_BIAS_DATA::ID => NAV_FILTER_BIAS_DATA::EXTRA_CRC,
36287 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
36288 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
36289 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
36290 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
36291 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
36292 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
36293 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
36294 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
36295 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
36296 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
36297 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
36298 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
36299 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
36300 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
36301 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
36302 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
36303 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
36304 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
36305 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
36306 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
36307 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
36308 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
36309 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
36310 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
36311 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
36312 PING_DATA::ID => PING_DATA::EXTRA_CRC,
36313 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
36314 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
36315 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
36316 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36317 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
36318 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
36319 RADIO_CALIBRATION_DATA::ID => RADIO_CALIBRATION_DATA::EXTRA_CRC,
36320 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
36321 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
36322 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
36323 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
36324 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
36325 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
36326 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
36327 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
36328 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
36329 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
36330 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
36331 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
36332 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
36333 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
36334 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
36335 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
36336 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
36337 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
36338 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
36339 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
36340 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
36341 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
36342 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
36343 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36344 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
36345 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36346 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
36347 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
36348 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36349 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
36350 }
36351 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36352 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
36353 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
36354 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
36355 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
36356 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
36357 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
36358 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
36359 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
36360 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
36361 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
36362 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
36363 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
36364 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
36365 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36366 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
36367 }
36368 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36369 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
36370 }
36371 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
36372 UALBERTA_SYS_STATUS_DATA::ID => UALBERTA_SYS_STATUS_DATA::EXTRA_CRC,
36373 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
36374 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
36375 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
36376 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
36377 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
36378 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
36379 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36380 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
36381 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
36382 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36383 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
36384 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
36385 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
36386 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
36387 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
36388 _ => 0,
36389 }
36390 }
36391 fn target_system_id(&self) -> Option<u8> {
36392 match self {
36393 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
36394 Self::CANFD_FRAME(inner) => Some(inner.target_system),
36395 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
36396 Self::CAN_FRAME(inner) => Some(inner.target_system),
36397 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
36398 Self::COMMAND_ACK(inner) => Some(inner.target_system),
36399 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
36400 Self::COMMAND_INT(inner) => Some(inner.target_system),
36401 Self::COMMAND_LONG(inner) => Some(inner.target_system),
36402 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
36403 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
36404 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
36405 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
36406 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
36407 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
36408 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
36409 Self::LOGGING_ACK(inner) => Some(inner.target_system),
36410 Self::LOGGING_DATA(inner) => Some(inner.target_system),
36411 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
36412 Self::LOG_ERASE(inner) => Some(inner.target_system),
36413 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
36414 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
36415 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
36416 Self::MISSION_ACK(inner) => Some(inner.target_system),
36417 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
36418 Self::MISSION_COUNT(inner) => Some(inner.target_system),
36419 Self::MISSION_ITEM(inner) => Some(inner.target_system),
36420 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
36421 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
36422 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
36423 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
36424 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
36425 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
36426 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
36427 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
36428 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
36429 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
36430 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
36431 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
36432 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
36433 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
36434 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
36435 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
36436 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
36437 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
36438 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
36439 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
36440 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
36441 Self::PARAM_SET(inner) => Some(inner.target_system),
36442 Self::PING(inner) => Some(inner.target_system),
36443 Self::PLAY_TUNE(inner) => Some(inner.target_system),
36444 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
36445 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
36446 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
36447 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
36448 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
36449 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
36450 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
36451 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
36452 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
36453 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
36454 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
36455 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
36456 Self::SET_MODE(inner) => Some(inner.target_system),
36457 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
36458 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
36459 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
36460 Self::TIMESYNC(inner) => Some(inner.target_system),
36461 Self::TUNNEL(inner) => Some(inner.target_system),
36462 Self::V2_EXTENSION(inner) => Some(inner.target_system),
36463 _ => None,
36464 }
36465 }
36466 fn target_component_id(&self) -> Option<u8> {
36467 match self {
36468 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
36469 Self::CANFD_FRAME(inner) => Some(inner.target_component),
36470 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
36471 Self::CAN_FRAME(inner) => Some(inner.target_component),
36472 Self::COMMAND_ACK(inner) => Some(inner.target_component),
36473 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
36474 Self::COMMAND_INT(inner) => Some(inner.target_component),
36475 Self::COMMAND_LONG(inner) => Some(inner.target_component),
36476 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
36477 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
36478 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
36479 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
36480 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
36481 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
36482 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
36483 Self::LOGGING_ACK(inner) => Some(inner.target_component),
36484 Self::LOGGING_DATA(inner) => Some(inner.target_component),
36485 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
36486 Self::LOG_ERASE(inner) => Some(inner.target_component),
36487 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
36488 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
36489 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
36490 Self::MISSION_ACK(inner) => Some(inner.target_component),
36491 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
36492 Self::MISSION_COUNT(inner) => Some(inner.target_component),
36493 Self::MISSION_ITEM(inner) => Some(inner.target_component),
36494 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
36495 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
36496 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
36497 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
36498 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
36499 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
36500 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
36501 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
36502 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
36503 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
36504 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
36505 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
36506 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
36507 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
36508 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
36509 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
36510 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
36511 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
36512 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
36513 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
36514 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
36515 Self::PARAM_SET(inner) => Some(inner.target_component),
36516 Self::PING(inner) => Some(inner.target_component),
36517 Self::PLAY_TUNE(inner) => Some(inner.target_component),
36518 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
36519 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
36520 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
36521 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
36522 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
36523 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
36524 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
36525 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
36526 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
36527 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
36528 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
36529 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
36530 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
36531 Self::TIMESYNC(inner) => Some(inner.target_component),
36532 Self::TUNNEL(inner) => Some(inner.target_component),
36533 Self::V2_EXTENSION(inner) => Some(inner.target_component),
36534 _ => None,
36535 }
36536 }
36537}